Skip to content

ganesh47/totp-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);