otplib API Documentation / @otplib/core / utils / NormalizeHashAlgorithmOptions
Type Alias: NormalizeHashAlgorithmOptions
NormalizeHashAlgorithmOptions =
object
Defined in: packages/core/src/utils.ts:373
Options for normalizeHashAlgorithm
Properties
plugin?
optionalplugin?:string
Defined in: packages/core/src/utils.ts:392
Name of the calling crypto plugin, used to enrich the error message
supported?
optionalsupported?: readonlyHashAlgorithm[]
Defined in: packages/core/src/utils.ts:387
Accepted algorithms
Omitted and empty mean different things, deliberately. Omitting it (or passing undefined) accepts all of HASH_ALGORITHMS - the backward-compatible reading for a CryptoPlugin written before algorithms existed, which supports the full set by definition. An explicit [] declares support for nothing and rejects every algorithm; it must never fall back to the full set, or a plugin could not express that.
Intersected with HASH_ALGORITHMS, so this can only ever narrow the allowlist - a crypto plugin cannot widen the library's supported set.