===.
It has the same signature as Node’s
crypto.timingSafeEqual.
Example: Verifying a webhook signature
src/app/webhooks/signed-event.webhook.ts
API
timingSafeEqual(a, b): boolean
Returns true when both buffers hold the same bytes.
Parameters
ArrayBuffer | ArrayBufferView
required
The first buffer.
ArrayBuffer | ArrayBufferView
required
The second buffer. Must have the same byte length as
a.Errors
- Throws a
RangeErrorwhenaandbhave different byte lengths. - Throws a
TypeErrorwhen either input is not anArrayBufferor a view, such as a string.