toHexBytes function

Uint8List toHexBytes(
  1. List<int> input, {
  2. Base16Codec? codec,
  3. bool upper = false,
})

Converts 8-bit integer sequence to Base-16 and returns the ASCII bytes.

This is the same as toHex but returns the encoded characters as a Uint8List of ASCII codes, skipping the intermediate String.

Parameters:

  • input is a sequence of 8-bit integers.
  • If upper is true, the uppercase standard alphabet is used.
  • codec is the Base16Codec to use. It is derived from the other parameters if not provided.

Implementation

Uint8List toHexBytes(
  List<int> input, {
  Base16Codec? codec,
  bool upper = false,
}) {
  codec ??= _codecFromParameters(upper: upper);
  return codec.encoder.convert(input);
}