Skip to content

otplib API Documentation / @otplib/core / utils / validateByteLengthEqual

Function: validateByteLengthEqual() ​

validateByteLengthEqual(a, b): boolean

Defined in: packages/core/src/utils.ts:729

Validate that two byte arrays have equal length

Useful as a preliminary check before performing byte-by-byte comparisons.

Parameters ​

a ​

Uint8Array

First byte array

b ​

Uint8Array

Second byte array

Returns ​

boolean

true if arrays have equal length, false otherwise

Released under the MIT License.