Skip to content

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

Variable: bypassAsHex

const bypassAsHex: Base32Plugin

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

Hex string bypass - treats secrets as hex-encoded strings

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

Example

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

await generate({ secret: "48656c6c6f", base32: bypassAsHex, crypto });

Released under the MIT License.