UNPKG

squeakeasy

Version:

Fork of unmaintained module speakeasy. Two-factor authentication for Node.js. One-time passcode generator (HOTP/TOTP) with support for Google Authenticator.

13 lines (10 loc) 249 B
let s = require('./index') for (let i = 0; i < 1000; i++) { let sec = s.generateSecret() let b = new Buffer(sec.ascii, 'ascii') if (b.toString('hex') != sec.hex) { console.log(sec) throw new Error("hay") } console.log('ok...') }