function generatePassword(password_length: number) {
const charset: string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!$()";
let password: string = "";
let charset_len: number = charset.length;
for (let i: number = 0; i < password_length; i++) {
password += charset.charAt(Math.floor(Math.random() * charset_len));
}
return password;
}
console.log(generatePassword(12));
/*
run:
)$AuzwQ5LoI1
*/