#37106 [Opn->Bgs]: uniqid() without more_entropy extremally slow

From: Date: Sun, 28 May 2006 12:34:07 +0000
Subject: #37106 [Opn->Bgs]: uniqid() without more_entropy extremally slow
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97698@lists.php.net to get a copy of this message
 ID:               37106
 Updated by:       helly@php.net
 Reported By:      webmaster at polskabizuteria dot pl
-Status:           Open
+Status:           Bogus
 Bug Type:         Performance problem
-Operating System: FreeBSD
+Operating System: *
-PHP Version:      5.1.2
+PHP Version:      *
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

uniqid() is meant to give you a certrain id distribuion that is not
predicable. That is uniqid() must neither generate two identical ids
nor have a constant or in any way predictable difference between two
calls. To ensure this we use usleep() internally to either force a
thread (windows) or process (*nix) switch. On some systems the
operating system has a slow implementation of this. However
distrubition this much more important than the security risks implied.


Previous Comments:
------------------------------------------------------------------------

[2006-04-17 14:52:45] webmaster at polskabizuteria dot pl

Description:
------------
Uniquid() without second parameter (more_entropy) set as true is
extremaly slow (approx 500 times)

Reproduce code:
---------------
/* SLOW */

uniqid();
uniqid("");
uniqid("",false);

/* FAST */

uniqid("",true);



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37106&edit=1


Thread (3 messages)

« previous php.bugs (#97698) next »