note 27811 deleted from function.uniqid by didou
| From: | didou@php.net | Date: | Tue, 19 Aug 2003 14:09:31 +0000 |
| Subject: | note 27811 deleted from function.uniqid by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54675@lists.php.net to get a copy of this message | ||
Note Submitter: foo@example.com
----
UNIQID IS SLOW!!!
md5(microtime().posix_getpid()) is safer (and about 750x faster on an unloaded server) ... a single
uniqid takes about 20ms on a linux box due to this obscene snippet:
#if HAVE_USLEEP && !defined(PHP_WIN32)
if (!more_entropy) {
usleep(1);
}
#endif