Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92225 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10120 invoked from network); 12 Apr 2016 13:21:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2016 13:21:57 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.180 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.214.180 mail-ob0-f180.google.com Received: from [209.85.214.180] ([209.85.214.180:34429] helo=mail-ob0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/5C-28094-476FC075 for ; Tue, 12 Apr 2016 09:21:57 -0400 Received: by mail-ob0-f180.google.com with SMTP id bg3so11161545obb.1 for ; Tue, 12 Apr 2016 06:21: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=dNcBe1cxty/V+8YV07Feq0RGzAY79WcJCvKzILajr08=; b=A4/qYf6MLEl5b3S2Zk9lGgCZMM8v5X8KVceegMw7eMwtw9CusjOzbr5yWhubx391Jk 2ErkL/MJ01U+sobXfIvYqqaCZRbxghfDkMhUOTIh18iXRI7ILzI31t5l4ZdHU1ZfRt9j SsYLHhblN0QuHcM7EwL5XnaQIS/Jb3630+laoI9JanSfdNZgxm/bfnW6WjQ8VJini8jO 0yUK3cNOP1QBbMCaGcRx9tAhYI894SELkfbKtjaH6BdG6rYsf6e6Ks65OBtpgh4qoswM RlvtXoS41t+WDPaxM/3VZR6h+RYR8YAjP0pRTM8GNRL9ReGzuUKiYjjJkFFcpBZoQsCA LbRA== 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=dNcBe1cxty/V+8YV07Feq0RGzAY79WcJCvKzILajr08=; b=mQZDWdzSYgOYL1H+T74X1/0cUHGX5CX1G79kUYeBtMZkHQo5hCDCO47lhbWlLKC24x el0J7N2N5CZ9V3PMkCHRJqbSep6uowQ3KZiGXI+ctUPRsUSvR/RXztmcyHevGZtjfzrE FQ5ixCL35DatGjmBLdQdhDTyNhErROlzj/GA5978dwI+niQ/Ri3NcxMPdapMZv55MCPI zKJ26514aCmKX2pQltAXE7Ydxz7m72soieuk5WZh6VP3zwQjCaWzWg76uF/UGYIkdT2d X1XWbQhFO55re+z0P1+zjaZhzFZtmfl6rSiQ8fz+eM+/RukAYkMkCiez6tVT5pu/Edzt /Z6Q== X-Gm-Message-State: AOPr4FUFydgCtuZr/e/2tVWPCXVevTF1O/M9EbVQZpd4UMFkEm9c1yrwKjHb56VXbe6iBnm2pxkl3YB3TY6XaQ== MIME-Version: 1.0 X-Received: by 10.182.53.170 with SMTP id c10mr1503257obp.75.1460467313577; Tue, 12 Apr 2016 06:21:53 -0700 (PDT) Received: by 10.202.215.193 with HTTP; Tue, 12 Apr 2016 06:21:52 -0700 (PDT) Received: by 10.202.215.193 with HTTP; Tue, 12 Apr 2016 06:21:52 -0700 (PDT) In-Reply-To: References: <570C9101.5060500@php.net> Date: Tue, 12 Apr 2016 20:21:52 +0700 Message-ID: To: "Colin O'Dell" Cc: PHP internals , Sebastian Bergmann Content-Type: multipart/alternative; boundary=001a11c1d3426e97120530498bf7 Subject: Re: [PHP-DEV] UUID From: pierre.php@gmail.com (Pierre Joye) --001a11c1d3426e97120530498bf7 Content-Type: text/plain; charset=UTF-8 On Apr 12, 2016 7:56 PM, "Colin O'Dell" wrote: > > On Tue, Apr 12, 2016 at 2:09 AM 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? > > > > 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 --001a11c1d3426e97120530498bf7--