Skip to content

donriddo/otp-jslib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript library for generating OTP

How to use

yarn add otp-jslib
import { totp } from "otp-jslib";

const secret = "secret";
const otpLength = 6;
const id = "email@example.com";
const ttl = 300; // seconds

const otp = totp(secret,  otpLength, id, ttl);
console.log(otp);