Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92220 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2243 invoked from network); 12 Apr 2016 12:56:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2016 12:56:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=colinodell@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=colinodell@gmail.com; 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: colinodell@gmail.com X-Host-Fingerprint: 209.85.214.180 mail-ob0-f180.google.com Received: from [209.85.214.180] ([209.85.214.180:34248] helo=mail-ob0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/AA-28094-C80FC075 for ; Tue, 12 Apr 2016 08:56:44 -0400 Received: by mail-ob0-f180.google.com with SMTP id bg3so10675060obb.1 for ; Tue, 12 Apr 2016 05:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=goEF09G/RggNtYoy9zIoi9HMndiltcsuALgMciUqGcQ=; b=ekZPk3hWUdd3/PW0txxzM81vPH8zyPNP78lF5sfjwOju5vHQ5h+qrQ8x1gmVuV2QhR IMK9QMFH9NDJoPcTKwe0z9JOf8dPfiCl6xphzXjMEPme2aLu1duZeItLYg02AI7HWY/V ESa+onIoTuK4NauVY3kCdzOXvMIY+XtQTL7ZF/6mBGWL7KX4Zc83wtBLl1IaRG1pnwYM JNCUZorgjF3hPmYERz4zFcOvqh0A3XYYYYVaiD78fdboK7JB4/pkMx/0DYivNz8BlnpE RqnOGe1kg6VCwzDhfWUvNUvaogm9jOAe84id9ZAeC7QXGzsdB6cyrMiPdoGQvLjLm5i9 dK9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=goEF09G/RggNtYoy9zIoi9HMndiltcsuALgMciUqGcQ=; b=LExwfyBJhrWuPQC+ss46nhnPCqWxUAuJZd/zCBcMArVo4mQl7RBhFaTwHHaOz9dSEy /UvPgjsmJJUhPlA84ZjIilweQgvADyaiGt9+OYcFLBWjYfb83CzojFns4b69ExpbUWsz sTFP8RQ49QFS9O3HPawvkQQpfKzVzCjxH65YfmEQoeUvTbjJByugV4R7a0iIf1zFL8lf CjcdGN0F7elp9EUZvAVEziSP6pWsVkAA91WZddezbabD2Fo8ICIWwXxa2gReyHSwTasE roK9xG7QOhweKyLp2LpMOHgNdVlljCq+tY4mwIGTrnm5XATJlPQfWHTlvMT9vi/8tPC+ lLzQ== X-Gm-Message-State: AOPr4FWOhmxYn++C1iJ5CfxNHDPhEL7qULVSNThN81EK8/da2AGr/bDh2N7Ka9+GY2PNgW/i9BlwBlw2RsAM2A== X-Received: by 10.182.58.36 with SMTP id n4mr1451160obq.2.1460465801532; Tue, 12 Apr 2016 05:56:41 -0700 (PDT) MIME-Version: 1.0 References: <570C9101.5060500@php.net> In-Reply-To: <570C9101.5060500@php.net> Date: Tue, 12 Apr 2016 12:56:31 +0000 Message-ID: To: Sebastian Bergmann , PHP Internals Content-Type: multipart/alternative; boundary=e89a8f5038e64e9c7a053049314f Subject: Re: [PHP-DEV] UUID From: colinodell@gmail.com ("Colin O'Dell") --e89a8f5038e64e9c7a053049314f Content-Type: text/plain; charset=UTF-8 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? Regards, Colin --e89a8f5038e64e9c7a053049314f--