transformBufferToHexString function

String transformBufferToHexString(
  1. List<int> buffer
)

Transform buffer to hex string

Implementation

String transformBufferToHexString(List<int> buffer) {
  var str = buffer.fold<String>('', (previousValue, byte) {
    var hex = byte.toRadixString(16);
    if (hex.length != 2) hex = '0' + hex;
    return previousValue + hex;
  });
  return str;
}