Re: UUID
| From: | Pierre Joye | Date: | Tue, 12 Apr 2016 07:59:46 +0000 |
| Subject: | Re: UUID | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92212@lists.php.net to get a copy of this message | ||
On Tue, Apr 12, 2016 at 2:52 PM, Pierre Joye <pierre.php@gmail.com> wrote:
> On Apr 12, 2016 1:09 PM, "Sebastian Bergmann" <sebastian@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?
>
> Alternatively and maybe more portable, libuuid (should be part of all
> decent systems too) could be a first choice.
Forgot to mention: https://pecl.php.net/package/uuid
> BSD also provides
> compliant APIs as part of their libc
> (https://www.freebsd.org/cgi/man.cgi?query=uuid for freebsd f.e.). On
> Windows
>
> UuidCreate and UuidToString should do it but I did not check their
> compliance yet.
>
> For the reference here: by compliant, I mean compliant with
> https://tools.ietf.org/html/rfc4122
>
>
> Cheers,
> Pierre
--
Pierre
@pierrejoye | http://www.libgd.org