note 28582 added to function.uniqid
| From: | php-general at lists dot php dot net | Date: | Fri, 17 Jan 2003 12:06:51 +0000 |
| Subject: | note 28582 added to function.uniqid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42265@lists.php.net to get a copy of this message | ||
A more random (and thus better) prefix can be achieved with mt_rand():
list($usec, $sec) = explode(' ', microtime());
mt_srand((float) $sec + ((float) $usec * 100000));
$rand_string = md5(uniqid(mt_rand(), true));
--
http://www.php.net/manual/en/function.uniqid.php
http://master.php.net/manage/user-notes.php?action=edit+28582
http://master.php.net/manage/user-notes.php?action=delete+28582
http://master.php.net/manage/user-notes.php?action=reject+28582