/** * Compare byte slices without allocating string copies. */ export function bytesEqual(left: Uint8Array, right: Uint8Array): boolean { if (left.byteLength !== right.byteLength) return false; for (let index = 0; index < left.byteLength; index++) { if (left[index] !== right[index]) return false; } return true; }