Re: [RFC][DISCUSSION] Improve uniqid() uniqueness
| From: | Yasuo Ohgaki | Date: | Tue, 13 Sep 2016 11:10:13 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Improve uniqid() uniqueness | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95982@lists.php.net to get a copy of this message | ||
Hi Rowan,
On Tue, Sep 13, 2016 at 6:47 PM, Rowan Collins <rowan.collins@gmail.com> wrote:
> To me, uniqid() is useful because it is a quick way of getting a short
> string that's likely to be fairly unique. If that is its purpose, then
> making it slower, and its output longer, are not helping anybody.
>
> If it's purpose is to be truly random, and have controllable entropy, etc,
> then we might as well deprecate it in favour of random_bytes().
Reasonable.
Then enable more entropy and use php_random_byte() for it.
Question is what format:
- the same as now (digits and .)
- convert alphanumeric [0-v]
- convert to hex [0-f]
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net