or better yet paste
function generatePassword(length = 24) {
const chars =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;:,.<>?";
const charCount = BigInt(chars.length);
// Generate enough random bytes
const bytes = new Uint8Array(length * 2);
crypto.getRandomValues(bytes);
// Convert bytes → BigInt
let value = 0n;
for (const b of bytes) {
value = (value << 8n) | BigInt(b);
}
// Convert BigInt → password
let password = "";
for (let i = 0; i < length; i++) {
password += chars[Number(value % charCount)];
value /= charCount;
}
return password;
}
console.log(generatePassword());
into ur browser tab