uint8arrays
Version:
Utility functions to make dealing with Uint8Arrays easier
24 lines (20 loc) • 395 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function compare(a, b) {
for (let i = 0; i < a.byteLength; i++) {
if (a[i] < b[i]) {
return -1;
}
if (a[i] > b[i]) {
return 1;
}
}
if (a.byteLength > b.byteLength) {
return 1;
}
if (a.byteLength < b.byteLength) {
return -1;
}
return 0;
}
exports.compare = compare;