Package Exports
- totp-basic
- totp-basic/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (totp-basic) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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);