generate-random-password

Generate a random password consisting of upper and lowercase alpha-numeric characters and special characters with inputs for length, and percent chance of special characters occuring.

View on GitHub

generate-random-password

for Node / Npm and Client Side JS

npm version

Generate a random password consisting of upper and lowercase alpha-numeric characters and special characters with inputs for length, and percent chance of special characters occuring.

Special Characters are: ! # $ % & * + ? ~ @

Makes use of seedrandom.js by David Bau for random number generation.

DEFAULT:

usage:

npm i generate-random-password

let gpw = require( 'generate-random-password' );

// this will create a random password of length 8, and
// a 20% chance of special chars for each letter
let pw = gpw.generateRandomPassword( 8 );

OR

// this will create a random password of length 8, special characters
// having a 50% chance of showing up each letter
let pw = gpw.generateRandomPassword( 8, 50 );