hexadecimalStringToBytes static method

Uint8List hexadecimalStringToBytes(
  1. String hexString
)

Implementation

static Uint8List hexadecimalStringToBytes(String hexString) {
  Uint8List bytes = Uint8List(hexString.length ~/ 2);
  for (int i = 0; i < bytes.length; i++) {
    int pos = i * 2;
    bytes[i] = int.parse(hexString.substring(pos, pos + 2), radix: 16);
  }
  return bytes;
}