Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92212 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77903 invoked from network); 12 Apr 2016 07:59:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2016 07:59:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.48 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.218.48 mail-oi0-f48.google.com Received: from [209.85.218.48] ([209.85.218.48:34283] helo=mail-oi0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BB/96-28094-4FAAC075 for ; Tue, 12 Apr 2016 03:59:49 -0400 Received: by mail-oi0-f48.google.com with SMTP id s79so13028728oie.1 for ; Tue, 12 Apr 2016 00:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=ydsDPHBgxWoEOKQYMNZUW0BwwHcKcQVKnMMzYilUSGk=; b=LpNs2lKiW8Q0Ae6cQXwmwzigZzGnTumjW2U9xULnJ8Oq4vCURO4jekfcSza7B1AuAK zwBjs9hkEfqm7R3ZuPNM/zFiNLRwBnGk5VqwvfToKkExJrgXaQHijwYBH81LZu1jKbPA A3WRk5l7Bb5awLb7pjnvLZ+LsweERXAdfRY5b1sijg4uTRDYD+RdXwYyJMfz1FGTInSe vN4JmEC14Rkn6DTuim5adleL/gusHs3QgoEqLPQvC2SkrezZffNk1yQ0uIsGscjjezGn 1GHlamzC029g8cqI8+iCuGCjk6H9vDuvKuf/LNp9hdGfsIoXeZjDo7zf/in8f0mS1hcI +fzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ydsDPHBgxWoEOKQYMNZUW0BwwHcKcQVKnMMzYilUSGk=; b=MEGwkXITWwaFApGVAUd4/VpCAOgaAs6NnQlmrxDDZThoHphKruqz+cNqiu/7N59odD odui4lInPc7tSmYgTmbxOqoAxLlciOJ4dcq5jPxQRCAFXT0f7r5V45bV7qBlFdUwTs+a 2NwxyIgM4u3V0Zu8D9GEFENvadTPgT8pjHg2dQ8KXnIxsVBuS7Qb6TkIidA/lYv0JBK3 GzavAhTBO896GHrHC4Eeceiln936DOfoc+P8Wsx6evGFKVhQoE+XtpAg9yIJltEweCwK Fx1FmwuLkw4BP2uZAjad9y5oTleGQp21czGyK8BH/DTqFOAONNc8xndjG89ASggyc0A0 uHNg== X-Gm-Message-State: AOPr4FVXJUjGSiZJ2QPgJzib4L4kuoSlrtY0I2ZbNuATu1szAedawWCnk3DRmZ6hermtvJLMpkZMYa6MOZeLog== MIME-Version: 1.0 X-Received: by 10.157.12.155 with SMTP id b27mr893575otb.0.1460447986564; Tue, 12 Apr 2016 00:59:46 -0700 (PDT) Received: by 10.202.215.193 with HTTP; Tue, 12 Apr 2016 00:59:46 -0700 (PDT) In-Reply-To: References: <570C9101.5060500@php.net> Date: Tue, 12 Apr 2016 14:59:46 +0700 Message-ID: To: Sebastian Bergmann Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] UUID From: pierre.php@gmail.com (Pierre Joye) On Tue, Apr 12, 2016 at 2:52 PM, Pierre Joye wrote: > On Apr 12, 2016 1:09 PM, "Sebastian Bergmann" 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