Browsing through some of our (older) code, I found the following gem. The script is used to set up web hosting and install applications in it and therefore needs to generate some new passwords:
function randomkeys($length) {
$pattern = "1234567890abcdefghijkmnpqrstuvwxyz";
$key = $pattern{rand(0,35)};
for($i=1;$i<$length;$i++){
$key .= $pattern{rand(0,35)};
}
return $key;
}
Not too much of a WTF, but read on:function randomkeysPassword($length) {
...
}
function randomEmailPass($length) {
...
}
function randomkeysCMSPassword($length) {
...
}
What's in the body of these three functions is left as an exercise to the reader ;)