Skip to content

TypeScript API / laikacms/crypto / constantTimeEqualBuffer

Function: constantTimeEqualBuffer() ​

ts
function constantTimeEqualBuffer(a, b): Promise<boolean>;

Constant-time buffer comparison using HMAC. Uses crypto.subtle.sign to compute HMACs and compare them.

Parameters ​

ParameterTypeDescription
aUint8ArrayFirst buffer to compare
bUint8ArraySecond buffer to compare

Returns ​

Promise<boolean>

true if buffers are equal, false otherwise

Released under the MIT License.