Generate a random string
11
Creates a random string, usefull for passwords etc.
Use: $password = makeRandomPassword($Length);
If $Length is not specified (ie $password = makeRandomPassword();) then it will default to 8 characters
Use: $password = makeRandomPassword($Length);
If $Length is not specified (ie $password = makeRandomPassword();) then it will default to 8 characters






One minor bit of semantics (since I'm the devil for varname sematics): $salt isn't actually a salt. A salt is variable seed value concatenated with a key to produce different, but still verifiable, output from subequent encryptions/hashings. $salt might be more intuitively called $charset, since it IS the charset from which passwords are drawn.
Oh, and that wasn't idle praise. I'm grabbing this and rewriting it in C for another project of mine as we speak.
Cheers!
I've got good news, and I've got bad news:
The universe is merely a figment of my imagination.
Now are you ready for the bad news?