Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92211 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76175 invoked from network); 12 Apr 2016 07:53:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2016 07:53:02 -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.52 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.218.52 mail-oi0-f52.google.com Received: from [209.85.218.52] ([209.85.218.52:33319] helo=mail-oi0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/36-28094-859AC075 for ; Tue, 12 Apr 2016 03:52:56 -0400 Received: by mail-oi0-f52.google.com with SMTP id w85so12915403oiw.0 for ; Tue, 12 Apr 2016 00:52:56 -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=i3W6z7IG4Zk616meeALZx51QTirz81+SwJEdiPWeURw=; b=Pxc1TPyJ0XspX9ht1PbIXlqSZg5QcxP2Rk7UUp39MWTALPME0vL2eGVCCxD2hpj/TA 42rol1X2BbMcyLnbtvWstW45BIoo8oc6jRGh8kixX8ZkHA1wR7PRL4fkE9UBNza97f0y xEDPtjBeMuwSfn/vn+eH8DjFP9fwnqBy0/3Mu2dsee/OuQZPE9asGMffK71PWbh9CpaX FFCZ0DQtsYeRKtZITIq5e7ryd+VQdzx52HIqIjh5pXV31VdL4j8hvwcsakgdNXm7rPs3 bWHY9EtWSuGfv4TNxekuNlrrEGshBS8Q9RPap19bP8JXuInF7/AD+DeU2T8tFdFyF1KG +CoQ== 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=i3W6z7IG4Zk616meeALZx51QTirz81+SwJEdiPWeURw=; b=kWBZdztaTrQSQuvhziLjPKcHQHlqNTsGiCUvwixQzxncxGKq/F01kIcNtJ/q3pM0pE kGSQyA+9q5jN2E2tsHCG7lYJuYPUgY619bX4bA7JtdJJJBmBMoWmYtHodQpGWYEwr3v/ i2NGnvV8AjeL/8REzq/fydSyBUv1bxSupKMvowqeKWKerGJwkP07tIqEQvCIqgUvqqBp bHTTiR/CM+VJsq6jZ8lYIXkoCopYYvQ0DYkMLzUgb84dIFm88Qw50soseZx/1T1RCE8a fvhImk7WrFb4FP9OkTpgQm0zva3+VuO8fM9EIB2gGLRlqHxYOhId5Tw1IoT+w5y0K5lY rqlQ== X-Gm-Message-State: AOPr4FW0+cgVscmjOtEMBEuwLe6JEv/Z6HMLl8ZPdu7DCci2XlkjryesEf3yM9e6EgX2Jum627cN89M5E7MJQg== MIME-Version: 1.0 X-Received: by 10.157.43.163 with SMTP id u32mr773809ota.80.1460447574006; Tue, 12 Apr 2016 00:52:54 -0700 (PDT) Received: by 10.202.215.193 with HTTP; Tue, 12 Apr 2016 00:52:53 -0700 (PDT) In-Reply-To: <570C9101.5060500@php.net> References: <570C9101.5060500@php.net> Date: Tue, 12 Apr 2016 14:52:53 +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 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. 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