Skip to content

otplib API Documentation / @otplib/core / utils / getDigestSize

Function: getDigestSize() ​

getDigestSize(algorithm): number

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

Get HMAC digest size in bytes for a given algorithm

Parameters ​

algorithm ​

HashAlgorithm

The hash algorithm

Returns ​

number

Digest size in bytes

Throws ​

If the algorithm is not supported

Released under the MIT License.