Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

otp-js

Functions to calculate HMAC-based One Time Password (HOTP) and Time-based One Time Password (TOTP)

Example Usage

const otp = require('@rbard/otp')

const key = {key: '5RAFOILIBQPR3LOW333VF6DSIQU6M5EN', encoding: 'base32'}

const {token, secondsLeft} = otp.totp(key)
const otp = require('@rbard/otp')

const key = {key: '5RAFOILIBQPR3LOW333VF6DSIQU6M5EN', encoding: 'base32'}

const counter = Buffer.alloc(8, 0)
counter.writeUInt32BE(55226733, 4)
const token = otp.hotp(key, counter)

About

Functions to calculate HMAC-based One Time Password (HOTP) and Time-based One Time Password (TOTP)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages