HOTP(RFC 4226) & TOTP(RFC 6238) & Steam Guard TOTP
https://totp-wasm-zig.vercel.app
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
Requirements:
# pnpm install
zig build
zig build bind
pnpm install
pnpm test:browser
Here are some related projects that you may find useful:
- totp-wasm: Rust implementation of this project.
- UdonOTPLib: C# implementation for the VRChat game.
Code is distributed under MIT license, feel free to use it in your proprietary projects as well.