Re: [RFC][DISCUSSION] Improve uniqid() uniqueness
| From: | Pierre Joye | Date: | Mon, 12 Sep 2016 12:48:25 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Improve uniqid() uniqueness | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95944@lists.php.net to get a copy of this message | ||
Hi,
On Sep 12, 2016 5:48 PM, "Kazuo Oishi" <kazuo@o-ishi.jp> wrote:
>
> Hi,
>
> > I know some code breaks, but it's not many. It's not fatal BC also.
> >
> > IMHO, uniqid() should try to generate uniqid() possible. uniqid() does
produce
> > non unique ID because it is system time based. This change mitigates
impact of
> > misuse also which is common in both open and close codes.
> >
> > Which is important?
> > - Fix known issues and generate unique ID (as much as possible)
> > - Let it generate non unique ID and ignore for some code may complain.
>
> IMO, improving it (generate better semi-unique ID) is not important
> enoungh to introduce unnecessary BC break. (Why returning string length
> is changed?)
I fully agree.
> If good unique ID generator is needed in core, please create new
> function with another name like "unique_id".
I would prefer to document the limitations and point to uuid or the Peng
instead of trying to fix something that was not designed to achieve that
(or was but at a time where the results were acceptable).
> --
> Kazuo Oishi
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>