Skip to content

otplib API Documentation / @otplib/core / requireBase32String

Function: requireBase32String()

requireBase32String(secret): asserts secret is string

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

Require secret to be a Base32 string (for URI generation)

Parameters

secret

The secret value

string | Uint8Array<ArrayBufferLike>

Returns

asserts secret is string

Throws

If secret is not a string

Released under the MIT License.