tweb-i2p/src/helpers/bytes/bytesCmp.ts
Eduard Kuzmenko 37d5b2a9ad Peer-to-Peer calls
Refactor bigInt
Refactor factorizing
2022-03-23 17:15:07 +02:00

15 lines
294 B
TypeScript

export default function bytesCmp(bytes1: number[] | Uint8Array, bytes2: number[] | Uint8Array) {
const len = bytes1.length;
if(len !== bytes2.length) {
return false;
}
for(let i = 0; i < len; ++i) {
if(bytes1[i] !== bytes2[i]) {
return false;
}
}
return true;
}