Modified by www.SourceFiles.app

This commit is contained in:
2026-08-07 04:15:22 +00:00
parent 4d3672a4f0
commit f59e5e579e
+7
View File
@@ -0,0 +1,7 @@
// 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("");
}