totp-basic

A totp library in ts

APACHE-2.0 License

Downloads
31
Stars
0

totp-basic

A totp library in typescript that requires no external libraries.

Uses crypto.subtle API support, so that it can be used in browsers, as-is! It can also be used in cloudflare-workers amongst others!

Usage

npm install totp-basic
import {verifyTOTP, generateTOTP} from "totp-basic";
        const secret = 'mysecret';
        const otp = await generateTOTP(secret);
        const isValid = await verifyTOTP(secret, otp);
Package Rankings
Top 22.38% on Npmjs.org
Related Projects