Skip to main content

HOTP & TOTP & Steam Guard TOTP

This package works with Bun, Node.js, Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers
JSR Score
58%
Published
4 months ago (0.1.2)

totp-wasm

HOTP(RFC 4226) & TOTP(RFC 6238) & Steam Guard TOTP

Demo

https://totp-wasm.vercel.app

Usage

Deno

import {
  totp,
  init,
  wasm_data,
} from 'https://deno.land/x/totp_wasm/deno/mod.ts'

await init(wasm_data)
const code = totp('GM4VC2CQN5UGS33ZJJVWYUSFMQ4HOQJW', 1662681600, 6, 30)
console.log(code)
// 473526

License

Code is distributed under MIT license, feel free to use it in your proprietary projects as well.

Add Package

deno add @gizmo-ds/totp-wasm

Import symbol

import * as mod from "@gizmo-ds/totp-wasm";

Add Package

npx jsr add @gizmo-ds/totp-wasm

Import symbol

import * as mod from "@gizmo-ds/totp-wasm";

Add Package

yarn dlx jsr add @gizmo-ds/totp-wasm

Import symbol

import * as mod from "@gizmo-ds/totp-wasm";

Add Package

pnpm dlx jsr add @gizmo-ds/totp-wasm

Import symbol

import * as mod from "@gizmo-ds/totp-wasm";

Add Package

bunx jsr add @gizmo-ds/totp-wasm

Import symbol

import * as mod from "@gizmo-ds/totp-wasm";