1.0.1 • Published 2 years ago

@rbard/otp v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

2 years ago

1.0.0

2 years ago