hexToBytes function
Converts the hexadecimal string, which can be prefixed with 0x, to a byte sequence.
Implementation
Uint8List hexToBytes(String hexStr) {
final bytes = hex.decode(hexStr.stripOx());
if (bytes is Uint8List) {
return bytes;
}
return Uint8List.fromList(bytes);
}