bytesToHex static method

String bytesToHex(
  1. List<int> bytes, {
  2. bool include0x = false,
})

Implementation

static String bytesToHex(List<int> bytes, {bool include0x = false}) {
  final hex = bytes.map((b) => b.toRadixString(16).padLeft(2, '0')).join();
  return include0x ? '0x$hex' : hex;
}