[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Password generation.
- Subject: Re: [cobalt-users] Password generation.
- From: Daniel Neuhaus <cobalt.com@xxxxxxx>
- Date: Wed Aug 22 17:20:20 2001
- Organization: DNID
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
ben wrote on 21.08.2001:
> I am curious to find out what program is used to generate passwords when a
> new user registers to this forum.
> Anyone have any ideas?
I use the following PHP-function to generate passwords
<?
function FncRandomString($nAnzahl) {
srand(date("s"));
$strZeichen = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz123456789123456789";
$strRandom = "";
while (strlen($strRandom) < $nAnzahl) {
$strRandom .= substr($strZeichen,(rand()%(strlen($strZeichen))),1);
}
return ($strRandom);
}
echo "Password: " . FncRandomString(6);
?>
6 is the length of the password. There are no 0's O's and o's in the
password since many people don't see the difference between them.
Regards,
Daniel