+
+# generate a random password using only letters and numbers that look
+# particularly unique
+function new_readable_password($length = 8) {
+ $character_set = "ABCDEFHJKLMNPQRTUVWXY34789";
+ $code = "";
+
+ # PHP 4.2.0 and up seed the random number generator for you.
+ # Lets hope that it seeds with something harder to guess than the clock.
+ while($length--) {
+ $code .= $character_set{mt_rand(0, 25)}; # inclusive
+ }
+
+ return $code;
+}
+