random-1password
v0.0.3
Published
Generate random passwords, special characters, uppercase letters, lowercase letters, numbers optional
Downloads
13
Readme
random-1password
Generate random passwords, special characters, uppercase letters, lowercase letters, numbers optional
Install
npm install random-1password
Example
import RandomPassword from 'random-1password';
// 得到一个长度8位的包含大小写字母、数字、特殊字符(!@#$%^&*()_+-=[]{}|;:,.<>?)的字符串
const rpd = new RandomPassword();
const pwd = rpd.generate();
// 得到一个长度9位的包含大小写字母、数字、特殊字符(!@#$%^&*()_+-=[]{}|;:,.<>?)的字符串
const rpd = new RandomPassword();
const pwd = rpd.generate(9);
// 得到一个长度9位的包含小写字母、数字、特殊字符(!@#$%^&*()_+-=[]{}|;:,.<>?)的字符串
const rpd = new RandomPassword();
let useLowercase = true, useUppercase = false, useNumbers = true, useSymbols = true;
const pwd = rpd.generate(9,useLowercase,useUppercase,useNumbers,useSymbols);
// 得到一个长度9位的包含大写字母、数字、特殊字符(!@#$%^&*()_+-=[]{}|;:,.<>?)的字符串
const rpd = new RandomPassword();
let useLowercase = false, useUppercase = true, useNumbers = true, useSymbols = true;
const pwd = rpd.generate(9,useLowercase,useUppercase,useNumbers,useSymbols);
// 得到一个长度9位的只包含大写字母的字符串
const rpd = new RandomPassword();
let useLowercase = false, useUppercase = true, useNumbers = false, useSymbols = false;
const pwd = rpd.generate(9,useLowercase,useUppercase,useNumbers,useSymbols);
// 密码强弱度检查
const rpd = new RandomPassword();
const pwd = "4uqGKSMl,M@b";
const status = rpd.checkStrength(pwd) // strong
To do
- [X] 密码强弱度校验