Skip to content

Generate One-Time passwords in JS using WebCrypto API

License

Notifications You must be signed in to change notification settings

dpikalov/hotp-totp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hotp-totp

npm npm license npm downloads

Generate One-Time passwords in JS using WebCrypto

Usage

// Time-based one-time password
await totp('SECRETSECRET')
// HMAC-based one-time password
await hotp('SECRETSECRET', 0 /* counter */) #=> 977742

Installation

  $ npm install hotp-totp