note 15538 added to function.crypt
| From: | admin at zendoken dot net | Date: | Sun, 16 Sep 2001 14:54:38 +0000 |
| Subject: | note 15538 added to function.crypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18059@lists.php.net to get a copy of this message | ||
Nice easy and quick random 32 char string generator. Very usefull for salts and logins. You decide
if it needs to be md5'd at the end.
<?
$useridseeds =
array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
$newuserid = "";
for ($i=0;$i<32;$i++) {$newuserid = $newuserid.$useridseeds[rand(0,count($useridseeds))];}
$newuserid = md5($newuserid);
?>
http://www.php.net/manual/en/function.crypt.php