I want to generate a random string that has to have 5 letters from a-z and 3 numbers.
How can I do this with JavaScript?
I\'ve got the following script, but
Any password generated with Math.random() is EXTREMELY BAD.
This function uses the system time as a seed for the random number generator. Anyone who knows the time the password was generated can easily brute-force the password.
In almost all cases, this data is easily available - just take the registration_time column in a hacked database, and test out all the values generated by the Math.random() algorithm using the times from 15 to 0 minutes before.
A password generated with Math.random() is completely worthless because the time the password was first used is enough for cracking it.