-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript7.js
27 lines (24 loc) · 1.02 KB
/
script7.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function generatePassword(passwordLength,includeLowercase,includeUppercase,includeNumber,includeSymbol){
const lowercasechar = "qwertyuiopasdfghjklzxcvbnm";
const uppercasechar = "QWERTYUIOPASDFGHJKLZXCVBNM"
const numberchar = "0123456789";
const symbolchar = "!@#$%^&*/()_-+="
let allowedchars = "";
let passowrd = "";
if(passwordLength <=0){
console.log(`password length must be greater than 12`);
}
allowedchars +=includeLowercase ? lowercasechar : "";
allowedchars +=includeUppercase ? uppercasechar : "";
allowedchars +=includeNumber ? numberchar : "";
allowedchars +=includeSymbol ? symbolchar : "";
console.log(allowedchars);
return '';
}
const passwordLength = 0;
const includeLowercase = false;
const includeUppercase = true;
const includeSymbol = false;
const includeNumber = true;
const password = generatePassword(passwordLength,includeLowercase,includeUppercase,includeSymbol,includeNumber)
console.log(`generted passowrd is ${password}`);