All files / src/utils xor.ts

100% Statements 5/5
100% Branches 1/1
100% Functions 2/2
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 61x 143x 1x 2537x    
export function xor(lhs: Uint8Array, rhs: Uint8Array): Uint8Array {
    if (lhs.length !== rhs.length)
        throw new Error('Xor operands must be the same length.');
    return lhs.map((lhsElement, index) => lhsElement ^ rhs[index]);
}