In this project, I created a password generator that would randomly generate a password when the button is clicked, given user input. The user was asked for the following criteria:
1.) Password length between 8 to 128 characters 2.) Character type to include: uppercase, lowercase, number, and/or special chararcters
The program requires a password length between 8 and 128 characters. If the user enters a value outside this range, they will receive an error alert before being prompted to enter the password length again.
This program uses prompts, alerts, loops, conditionals, and the DOM.
I attempted to check the password generated by the program to ensure that at least one of each selected character type was present in the password. However, I was not successful. I still want to play with the logic to see if I can make up my own method of ensureing each character type. I understand the two options shown in class, which were:
- Force the generator to select a specified number of characters from each type, and then shuffle the result. or
- Create a random password and an array that contains a random character from each character type that is superimposed over the first characters of the random password.
If I fail to find a different solution, I will use the second method but shuffle the result so that my "guaranteed" characters do not always occur at the beginning of the password.