A simple library for deriving one-time passwords from a base32 key.
npm install one-time-passwordA simple library for deriving one-time passwords from a base32 key.
These instructions will give you a copy of the project up and running on
your local machine for development and testing purposes.
Requirements:
- Node.js
- NPM (Node.js package manager)
Install with:
npm install one-time-password
``typescript
import * as OTP from 'one-time-password';
// A base32-encoded key.
const dummyKey: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
// Derive a 6-digit, time-based token from 'dummyKey'.
const token: string = OTP.generate(dummyKey);
// If token is valid.
console.log(OTP.verify(dummyKey, token));
``
- Creative Commons - Used to choose
the license
We use Semantic Versioning for versioning.
- Billie Thompson - Provided README Template -
PurpleBooth
- Shane Davenport - Library Author -
Github
This project is licensed under the MIT License
Creative Commons License - see the LICENSE.md file for details.