bufEquals function
Implementation
bool bufEquals(ByteBuffer b1, ByteBuffer b2) {
if (b1.lengthInBytes != b2.lengthInBytes) return false;
final u1 = Uint8List.fromList(b1.asUint8List());
final u2 = Uint8List.fromList(b2.asUint8List());
for (var i = 0; i < u1.length; i++) {
if (u1[i] != u2[i]) return false;
}
return true;
}