Files
console-dev/app/lib/password-2.js
T
2026-11-06 00:04:38 +08:00

22 lines
542 B
JavaScript

function e(e = 12) {
let t = (e) => e[Math.floor(Math.random() * e.length)],
n = [
t(`abcdefghjkmnpqrstuvwxyz`),
t(`ABCDEFGHJKMNPQRSTUVWXYZ`),
t(`23456789`),
],
r = Array.from(
{
length: Math.max(0, e - n.length),
},
() => t(`abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789`),
),
i = [...n, ...r];
for (let e = i.length - 1; e > 0; e--) {
let t = Math.floor(Math.random() * (e + 1));
[i[e], i[t]] = [i[t], i[e]];
}
return i.join(``);
}
export { e as t };