fromBinarySync method

String fromBinarySync(
  1. Uint8List bytes
)

Implementation

String fromBinarySync(Uint8List bytes) {
  // var bytes = await File("path").readAsBytes();
  //String s = "";
  StringBuffer sb = StringBuffer();
  for (var b in bytes) {
    // b belongs to [0,255]
    var p1 = (b & 240) >> 4; // 0b11110000
    var p2 = b & 15; // 0b00001111
    //s += dict[p1] + dict[p2];
    sb.write(dict[p1]);
    sb.write(dict[p2]);
  }
  return sb.toString();
}