Socket
Socket
Sign inDemoInstall

otp-generators

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    otp-generators

Generate OTP with specific digits and seeds


Version published
Weekly downloads
214
decreased by-16.08%
Maintainers
1
Install size
3.33 kB
Created
Weekly downloads
 

Readme

Source

otp-generator

Generate OTP with specific digits and seeds

NPM

Index

Install

npm i otp-generators

Usage

var newOTP = require('otp-generators')
            // or
import newOTP from 'otp-generators';

// For numeric OTP
newOTP.generate(6, { alphabets: false, upperCase: false, specialChar: false });

// For alphanumeric OTP
newOTP.generate(6, { alphabets: true, upperCase: false, specialChar: false });

// For alphanumeric with upperCase
newOTP.generate(6, { alphabets: true, upperCase: true, specialChar: false });

// For alphanumeric with special characters 
newOTP.generate(6, { alphabets: true, upperCase: true, specialChar: true });

generate(length, options)

Arguments

  • length - length of password. Optional if options is optional. default length is 6.
  • options - optional
    • digits - Default: true true value includes digits in OTP
    • alphabets - Default: true true value includes alphabets in OTP
    • upperCase - Default: true true value includes uppercase alphabets in OTP
    • specialChar - Default: true true value includes special Characters in OTP

Keywords

FAQs

Last updated on 25 Sep 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc