UNPKG

@mintlify/common

Version:

Commonly shared code within Mintlify

11 lines (10 loc) 269 B
export function secureCompare(a, b) { let mismatch = a.length === b.length ? 0 : 1; if (mismatch) { b = a; } for (let i = 0, il = a.length; i < il; ++i) { mismatch |= a.charCodeAt(i) ^ b.charCodeAt(i); } return mismatch === 0; }