On Apr 12, 2016 7:56 PM, "Colin O'Dell" <colinod...@gmail.com> wrote:
>
> On Tue, Apr 12, 2016 at 2:09 AM Sebastian Bergmann <sebast...@php.net>
> wrote:
>
> > In PHP 7.0 we introduced random_bytes() which wraps Linux's getrandom(2)
> > as well as Windows's CryptGenRandom() and uses /dev/urandom as a
fallback.
> >
> > I think it would be great if we added a function that wraps
> > /proc/sys/kernel/random/uuid [2] and, if that exists, its equivalent on
> > Windows to make the generation of UUIDs easy.
> >
> > Thoughts?
> >
>
> I'd love to see UUID generation in core using a similar platform-based
> approach, as long as the implementation matches RFC 4122.  Part of this
> will be determining which versions/variants should be supported:
>
https://en.wikipedia.org/wiki/Universally_unique_identifier#RFC_4122_Variant
>
> Version 4 (random) UUIDs is an obvious choice, but should any others be
> supported initially?
>
> Perhaps the implementation could be a simple function named random_uuid()
> which either takes no parameters or a single parameter "$version" which
> defaults to 4?

I would prefer not to refer to random to avoid any confusion with the
recent added random function. As uuid is not crypto safe and is not aimed
to. Users will then hopefully not think about using instead of the random
api.

Also uuid alone may be a problem (bc?) It sounds like a logical choice.
Alternatively uuid_create ().

Cheers
Pierre

Reply via email to