otp-generator
Generate OTP with specific digits and seeds
![NPM](https://nodei.co/npm/otp-generators.png?downloadRank=true&downloads=true)
Index
Install
npm i otp-generators
Usage
var newOTP = require('otp-generators')
import newOTP from 'otp-generators';
newOTP.generate(6, { alphabets: false, upperCase: false, specialChar: false });
newOTP.generate(6, { alphabets: true, upperCase: false, specialChar: false });
newOTP.generate(6, { alphabets: true, upperCase: true, specialChar: false });
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 OTPalphabets
- Default: true
true value includes alphabets in OTPupperCase
- Default: true
true value includes uppercase alphabets in OTPspecialChar
- Default: true
true value includes special Characters in OTP