JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 93
  • Score
    100M100P100Q71545F
  • License Apache-2.0

The TOTP & HOTP implement for Node.JS

Package Exports

  • @litert/otp
  • @litert/otp/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@litert/otp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

LiteRT/OTP

Strict TypeScript Checked npm version License GitHub issues GitHub Releases

The TOTP & HOTP implement for Node.JS.

Features

  • HOTP (HMAC-based One-Time Password) algorithm implementation.
  • TOTP (Time-based One-Time Password) algorithm implementation.
  • OTP URL encoding and decoding.
  • Command line tool:
    • Generating OTP codes.
    • Generating OTP URLs.
    • Inspecting OTP URLs.
  • Customization:
    • Digits length from 4 - 10
    • TOTP time-step (period)
    • Digest algorithms including SHA-1, SHA-256, and SHA-512

Requirements

  • TypeScript v3.1.x (Or newer)

Installation

npm i @litert/otp --save

Usage

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 environment

Then 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.