note 79422 deleted from function.microtime by tularis
| From: | tularis@php.net | Date: | Sun, 22 Jun 2008 12:04:43 +0000 |
| Subject: | note 79422 deleted from function.microtime by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140661@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
@zenofeller at zenofeller dot com:
I was trying to point out that randomString() significantly reduces the
"randomness-per-byte" compared to what mt_rand() and friends gives you to begin with - eg.
making it more "predictable".
If you're looking to generate hard-to-predict printable keys and cares about the length of the
key (you perhaps need to stick in in a CHAR(32) field of some db-table), you'd be better off
with either my rstr() or md5(uniqid(rand(), true)); which both will provide you with a much larger
keyspace (and thus a smaller chance of a collision) in the same amount of bytes as randomString().
I should have said "more predictable" instead of just "predictable" in my
previous post; you're indeed correct when you say that randomString() _will_ give you random
data. It most definitely does, it just doesn't do so very effectively :)