fromHex function
Converts 4-bit Base-16 character sequence to 8-bit integer sequence.
Parameters:
input
should be a valid Base-16 (hexadecimal) string.codec
is the Base16Codec to use. It is derived from the other parameters if not provided.
Throws:
- FormatException if the
input
contains invalid characters.
This implementation can handle both uppercase and lowercase alphabets. If a partial string is detected, the following bits are assumed to be zeros.
Implementation
Uint8List fromHex(
String input, {
Base16Codec? codec,
}) {
codec ??= _codecFromParameters();
return codec.decoder.convert(input.codeUnits);
}