Re: Re: [RFC][DISCUSSION] Improve uniqid() uniqueness

From: Date: Mon, 03 Oct 2016 12:06:30 +0000
Subject: Re: Re: [RFC][DISCUSSION] Improve uniqid() uniqueness
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-96194@lists.php.net to get a copy of this message
On 2 October 2016 at 21:03, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: > Hi all, > > On Mon, Oct 3, 2016 at 3:56 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: >> Besides improving "more entropy" the default and data, I prepared >> fully compatible patch to simplify discussion. >> >> >> https://gist.github.com/anonymous/fb615df325d559fa806a265031a06ede >> >> I would like to apply this patch from PHP 7.0 branch, then discuss what >> the default should be. >> >> Any comments? >> If there is no objections, I'll apply this few days later. > > Updated patch a little > > > https://gist.github.com/yohgaki/cbe5431f9d072b57af2883a2b5745195 > > Exception should not be ignored, but added few lines for this. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > I'm curious, did you consider using random_int? It already handles biasing, and you can reduce the repeated calls to random_bytes.

« previous php.internals (#96194) next »