compareBytes function
Compares two Uint8List bytes from the left-most to right-most byte. If all bytes are the same apart from one list being longer, the shortest list comes first.
Implementation
int compareBytes(Uint8List a, Uint8List b) {
for (int i = 0; i < a.length && i < b.length; i++) {
if (a[i] != b[i]) return a[i] - b[i];
}
return a.length - b.length;
}