Hi Leigh,

On Mon, Oct 3, 2016 at 9:06 PM, Leigh <lei...@gmail.com> wrote:
> I'm curious, did you consider using random_int? It already handles
> biasing, and you can reduce the repeated calls to random_bytes.

Yes. It seemed it might be slower due to number of retries at first,
but I realized that it isn't later.

It could be something like

$entropy = random_int(10000000000, 9999999999);
$entropy[1] = '.';
$uniqid = timestamp . $entropy;

I don't have particular preference.

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to