content-entry
Version:
content entries for content containers (aka files)
23 lines (20 loc) • 437 B
JavaScript
/**
* Returns true if the two passed Uint8Arrays have the same content
*
* @param {Uint8Array} a
* @param {Uint8Array} b
* @return {boolean} true if content of a equals b
*/
export function equalsUint8Arrays(a, b) {
if (a !== b) {
if (a.byteLength !== b.byteLength) {
return false;
}
for (let i = 0; i < a.byteLength; i++) {
if (a[i] !== b[i]) {
return false;
}
}
}
return true;
}