note 108478 added to function.rand
| From: | hans at llis dot nl | Date: | Sun, 29 Apr 2012 09:30:44 +0000 |
| Subject: | note 108478 added to function.rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187400@lists.php.net to get a copy of this message | ||
As Alex Khimch wrote earlier: the distribution of this function might be very biased. Therefore, do
NOT use this function to generate cryptographic keys or IV's unless you know exactly what
you're doing.
The example script that Alex posted shows in a very neat way how predictable the output of the
rand()-function is on your system. On my windows 7 system I got really neat patterns, but though
that might be nice as a wallpaper of sorts, it's not what I'm using a random function for
:)
----
Server IP: 83.137.20.135
Probable Submitter: 83.83.203.19
----
Manual Page -- http://www.php.net/manual/en/function.rand.php
Edit -- https://master.php.net/note/edit/108478
Del: integrated -- https://master.php.net/note/delete/108478/integrated
Del: useless -- https://master.php.net/note/delete/108478/useless
Del: bad code -- https://master.php.net/note/delete/108478/bad+code
Del: spam -- https://master.php.net/note/delete/108478/spam
Del: non-english -- https://master.php.net/note/delete/108478/non-english
Del: in docs -- https://master.php.net/note/delete/108478/in+docs
Del: other reasons-- https://master.php.net/note/delete/108478
Reject -- https://master.php.net/note/reject/108478
Search -- https://master.php.net/manage/user-notes.php