Skip to content

otplib API Documentation / @otplib/plugin-base32-alt / bypassAsString

Variable: bypassAsString

const bypassAsString: Base32Plugin

Defined in: plugin-base32-alt/src/index.ts:26

UTF-8 string bypass - treats secrets as plain text

Use this when your secret is a plain text string that should be converted directly to bytes without Base32 encoding.

Example

ts
import { bypassAsString } from '@otplib/plugin-base32-alt';
import { generate } from '@otplib/totp';

await generate({ secret: "mysecretkey", base32: bypassAsString, crypto });

Released under the MIT License.