Terminal
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
// Generate a readable temporary password (no ambiguous chars) for new accounts.
|
|
||||||
export function genTempPassword(len = 12): string {
|
|
||||||
const chars = "ABCDEFGHJKMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789";
|
|
||||||
const arr = new Uint32Array(len);
|
|
||||||
crypto.getRandomValues(arr);
|
|
||||||
return Array.from(arr, (n) => chars[n % chars.length]).join("");
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user