Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/otpauth/dist/otpauth.esm.min.js>Secret

One Time Password (HOTP/TOTP) library for Node.js, Deno and browsers.
Go to Latest
class Secret
import { Secret } from "https://deno.land/x/otpauth@v9.0.2/dist/otpauth.esm.min.js";

OTP secret key.

Constructors

new
Secret(unnamed 0?: { buffer?: ArrayBuffer | undefined; size?: number | undefined; } | undefined)

Creates a secret key object.

Properties

readonly
base32: string

Base32 string representation of secret key.

buffer: ArrayBuffer

Secret key.

readonly
hex: string

Hexadecimal string representation of secret key.

readonly
latin1: string

Latin-1 string representation of secret key.

readonly
utf8: string

UTF-8 string representation of secret key.

Static Methods

fromBase32(str: string): Secret

Converts a base32 string to a Secret object.

fromHex(str: string): Secret

Converts a hexadecimal string to a Secret object.

fromLatin1(str: string): Secret

Converts a Latin-1 string to a Secret object.

fromUTF8(str: string): Secret

Converts an UTF-8 string to a Secret object.