note 13317 deleted from function.uniqid by jimw

From: Date: Thu, 20 Dec 2001 20:06:25 +0000
Subject: note 13317 deleted from function.uniqid by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-23379@lists.php.net to get a copy of this message
I found that uniqid has a very bad performance. It takes about 16ms on my slow Pentium, and 20ms (sic!) on a fast Pentium 500MHz server. I use now something like: mt_srand ((double) microtime() * 1000000); $test = dechex(mt_rand(0,1000000000)); as a much faster replacement. Might not be as "unique", though. I found this with PHP4pl2, so maybe this has changed in later releases.

« previous php.notes (#23379) next »