@litert/otp
v2.0.0
Published
The TOTP & HOTP implement for Node.JS
Readme
LiteRT/OTP
The TOTP & HOTP implement for Node.JS.
Features
- [x] HOTP (HMAC-based One-Time Password) algorithm implementation.
- [x] TOTP (Time-based One-Time Password) algorithm implementation.
- [x] OTP URL encoding and decoding.
- [x] Command line tool:
- [x] Generating OTP codes.
- [x] Generating OTP URLs.
- [x] Inspecting OTP URLs.
- [x] Customization:
- [x] Digits length from 4 - 10
- [x] TOTP time-step (period)
- [x] Digest algorithms including SHA-1, SHA-256, and SHA-512
Requirements
- TypeScript v3.1.x (Or newer)
Installation
npm i @litert/otp --saveUsage
Use in code
See examples:
Click here for a quick start guide.
Use as a command line tool
npm i -g @litert/otp
# or install in local project only
npm i @litert/otp # -D # if only used in dev environmentThen you can generate TOTP codes
npx otp -k 'raw:1234567890'Click here for more details about the CLI usage.
Documents
License
This library is published under Apache-2.0 license.
