Helper routines for manipulating binary representations of data that are used within the OSDP.NET library and its unit tests.
More...
|
| static BitArray | HexStringToBitArray (string hex) |
| | Convert a string containing hex digits into BitArray.
|
| static BitArray | HexStringToBitArray (IEnumerable< char > hex) |
| | Convert a sequence of hex digit characters into BitArray.
|
| static IEnumerable< byte > | HexToBytes (IEnumerable< char > seq) |
| | Convert a sequence of hex digit characters into their byte representation.
|
| static string | BitArrayToString (BitArray arr) |
| | Convert the BitArray instance to a binary string representation.
|
Helper routines for manipulating binary representations of data that are used within the OSDP.NET library and its unit tests.
Definition at line 13 of file BinaryUtils.cs.
◆ BitArrayToString()
| string OSDP.Net.Utilities.BinaryUtils.BitArrayToString |
( |
BitArray | arr | ) |
|
|
inlinestatic |
Convert the BitArray instance to a binary string representation.
- Parameters
-
| arr | BitArray to be converted |
- Returns
- A string consisting almost entirely of 0s and 1s
Definition at line 66 of file BinaryUtils.cs.
◆ HexStringToBitArray() [1/2]
| BitArray OSDP.Net.Utilities.BinaryUtils.HexStringToBitArray |
( |
IEnumerable< char > | hex | ) |
|
|
static |
Convert a sequence of hex digit characters into BitArray.
- Parameters
-
| hex | Character sequence to be converted |
- Returns
- BitArray instance with most-significant bit first order
◆ HexStringToBitArray() [2/2]
| BitArray OSDP.Net.Utilities.BinaryUtils.HexStringToBitArray |
( |
string | hex | ) |
|
|
static |
Convert a string containing hex digits into BitArray.
- Parameters
-
| hex | String to be converted |
- Returns
- BitArray instance with most-significant bit first order
◆ HexToBytes()
| IEnumerable< byte > OSDP.Net.Utilities.BinaryUtils.HexToBytes |
( |
IEnumerable< char > | seq | ) |
|
|
inlinestatic |
Convert a sequence of hex digit characters into their byte representation.
- Parameters
-
| seq | character digit sequence to be converted |
- Returns
- Sequence of bytes
- Exceptions
-
| InvalidOperationException | Thrown if an invalid character is encountered |
Definition at line 39 of file BinaryUtils.cs.
Referenced by OSDP.Net.Tracing.MessageSpy.ParseCaptureFile().
The documentation for this class was generated from the following file: