bytesFromHex function
Implementation
Uint8List bytesFromHex(String hexData, {bool pad = false}) {
assert(hexData.length % 2 == 0, "hex data: $hexData = ${hexData.length}");
return pad
? Uint8List.fromList(hex.decode(hexData)).padLeft(hexData.length ~/ 2, 0)
: Uint8List.fromList(hex.decode(hexData));
}