This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if the Crypto API is available | |
if (window.crypto && window.crypto.getRandomValues) { | |
// Crypto API is available | |
} else { | |
// Crypto API is not supported, provide alternative method | |
console.error("Crypto API not supported in this browser."); | |
} | |
// Function to generate a secure random password | |
function generateRandomPassword(length, includeUppercase, includeLowercase, includeNumbers, includeSpecialChars) { |