toHexString static method

String toHexString(
  1. List<int> dataBytes, {
  2. bool lowerCase = true,
  3. String? prefix,
})

Encodes dataBytes as a hex string, optionally with prefix.

Implementation

static String toHexString(
  List<int> dataBytes, {
  bool lowerCase = true,
  String? prefix,
}) {
  final String toHex = hex.hex.encode(dataBytes, lowerCase: lowerCase);
  return "${prefix ?? ''}$toHex";
}