1.0.0 • Published 3 years ago
keygenerators v1.0.0
key-generate
Simple but powerfull middleware to randomly Creates an API key/password/access token using random string generation.(cryptographically strong) for your NodeJS projects
Installation
npm i key-generators --save
Usage
const keygenerate = require("keygenerators");
/*
* Default configuration
* length: whenever you call the function you passed the length as argument.
*/
/*
* generating a random api key with a length of 40 chars
*
*/
let apiKey = keygenerate(40);
// >> "QNpZpcAUReESnhfkmVmChk51X35IXREAX6U3j1Tp"
/*
* generating a random api password with length of 20 chars
*
*/
let apipassword = keygenerate(20);
// >> "pq1l13BiXAtRINsxeWMT"
/*
* generating a random transction id with length of 10 chars
*
*/
let transction_id = keygenerate(10);
// >> "eEWUtRyXLjXehnu"
API
Your key is generated from the combination of the following :
chars (bool)
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
numbers (bool)
0123456789
Licence
Module is licenced under the MIT
1.0.0
3 years ago