constantTimeCodesEqual(lengthA: number,lengthB: number,codeA: (i: number) => number,codeB: (i: number) => number,): boolean
Constant-time compare of two code sequences, given their lengths and a per-index code reader for each. Walks the longer sequence and folds every difference into one flag with XOR, so no early return leaks a length or the position of the first mismatch. Callers supply the code source (UTF-8 bytes, UTF-16 char codes, …), keeping this the single constant-time comparison loop.