@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
15 lines (14 loc) • 690 B
TypeScript
/**
* Constant-time bearer-token comparison.
*
* Bug 2 mitigation: a normal `===` compare on bearer tokens leaks the token
* length and the position of the first mismatching byte through timing
* differences, which is reachable when the voice server is bound publicly
* (`VOICE_SERVER_ALLOW_PUBLIC=1`).
*
* Returns `false` for any comparison whose lengths differ — this avoids the
* `RangeError` that `crypto.timingSafeEqual` throws on mismatched buffers
* while still preserving the constant-time property for equal-length inputs
* (which is the only case an attacker can probe).
*/
export declare function timingSafeEqualString(provided: string, expected: string): boolean;