Archived exercises hidden from selects. Password fields Show Password toggle
This commit is contained in:
9
src/utils/password.ts
Normal file
9
src/utils/password.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
export function generatePassword(length = 8): string {
|
||||
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+";
|
||||
let password = "";
|
||||
for (let i = 0; i < length; i++) {
|
||||
password += charset.charAt(Math.floor(Math.random() * charset.length));
|
||||
}
|
||||
return password;
|
||||
}
|
||||
Reference in New Issue
Block a user