Converts from/to byte arrays, integral values, and hex strings.
More...
|
static byte[] | ToBytes (long value, int length) |
| Converts a long value to byte array.
|
|
static long | ToLong (byte[] bytes, int index, int length) |
| Converts a byte array to a long value. Little endian only.
|
|
static string | ToHex (byte[] data) |
| Convert a byte array to a hex representation.
|
|
static byte[] | ToBytes (string data) |
| Convert a hex string to a byte array.
|
|
Converts from/to byte arrays, integral values, and hex strings.
◆ ToBytes() [1/2]
static byte[] Mku.Convert.BitConverter.ToBytes |
( |
long | value, |
|
|
int | length ) |
|
static |
Converts a long value to byte array.
- Parameters
-
value | The value to be converted. |
length | The length of the byte array to be returned. |
- Returns
- A byte array representation of the value.
◆ ToBytes() [2/2]
static byte[] Mku.Convert.BitConverter.ToBytes |
( |
string | data | ) |
|
|
static |
Convert a hex string to a byte array.
- Parameters
-
data | The hex string to be converted. |
- Returns
- The byte array converted from the string.
◆ ToHex()
static string Mku.Convert.BitConverter.ToHex |
( |
byte[] | data | ) |
|
|
static |
Convert a byte array to a hex representation.
- Parameters
-
data | The byte array to be converted. |
- Returns
- The hex string representation.
◆ ToLong()
static long Mku.Convert.BitConverter.ToLong |
( |
byte[] | bytes, |
|
|
int | index, |
|
|
int | length ) |
|
static |
Converts a byte array to a long value. Little endian only.
- Parameters
-
bytes | The byte array to be converted. |
index | The starting index of the data in the array that will be converted. |
length | The length of the data that will be converted. |
- Returns
- The long value representation of the byte array.
The documentation for this class was generated from the following file: