Skip to main content
Module

x/god_crypto/otp.ts>TOTP

Pure Javascript/Typescript Crypto Implementation for Deno. AES, RSA, HMAC, and TOTP
Very Popular
Latest
class TOTP
import { TOTP } from "https://deno.land/x/god_crypto@v1.4.11/otp.ts";

Constructors

new
TOTP(
secret: string,
digits?: number,
algorithm?: "sha1" | "sha256",
period?: number,
)

Properties

protected
algorithm: "sha1" | "sha256"
protected
digits: number
protected
period: number
protected
secret: Uint8Array
protected
secretInBase32: string

Methods

generate(timestamp?): string
uri(name: string, issuer: string): string
verify(code: string, timestamp?): boolean

Static Methods

generateSecret(numberOfByte: number)