Members
(static, constant) HexStringRegex
Regular expression for testing HexString string.
Methods
(static) isHexString(input) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
input |
string | the string to test. |
Check if the passed input string is a hexadecimal string.
Returns:
Type: boolean
(static) ensureHexString(input) → {HexString}
Parameters:
Name | Type | Description |
---|---|---|
input |
string | the string to test. |
Ensure that the passed string is a hexadecimal string.
Returns:
Type: HexString
(static) uint8arrayToHexString(buffer) → {HexString}
Parameters:
Name | Type | Description |
---|---|---|
buffer |
Uint8Array | The Uint8Array to convert to a hex string. |
Converts contents of Uint8Array to a hexadecimal string.
Returns:
Type: HexString
(static) hexToUint8Array(input) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
input |
HexString | The string that shall be converted. It must consist of an even number of the characters 0-9, a-f, A-F. |
Converts a hexadecimal string to an Uint8Array.
Returns:
Type: Uint8Array
(static) hexToUint8ArrayWithCheck(input) → {Uint8Array}
Parameters:
Name | Type | Description |
---|---|---|
input |
string | The string that shall be converted. It must consist of an even number of the characters 0-9, a-f, A-F. |
Converts a hexadecimal string to an Uint8Array with an additional regex test.
Returns:
Type: Uint8Array