Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99169 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95340 invoked from network); 25 May 2017 10:34:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2017 10:34:21 -0000 Authentication-Results: pb1.pair.com header.from=michal@brzuchalski.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=michal@brzuchalski.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain brzuchalski.com designates 188.165.245.118 as permitted sender) X-PHP-List-Original-Sender: michal@brzuchalski.com X-Host-Fingerprint: 188.165.245.118 ns220893.ip-188-165-245.eu Received: from [188.165.245.118] ([188.165.245.118:50601] helo=poczta.brzuchalski.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/25-10292-A23B6295 for ; Thu, 25 May 2017 06:34:20 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by poczta.brzuchalski.com (Postfix) with ESMTP id E8AB82984235 for ; Thu, 25 May 2017 12:34:14 +0200 (CEST) Received: from poczta.brzuchalski.com ([127.0.0.1]) by localhost (poczta.brzuchalski.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9L9PYCuNcR6e for ; Thu, 25 May 2017 12:34:11 +0200 (CEST) Received: from mail-wm0-f42.google.com (unknown [74.125.82.42]) by poczta.brzuchalski.com (Postfix) with ESMTPSA id 256362984233 for ; Thu, 25 May 2017 12:34:11 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id e127so98258616wmg.1 for ; Thu, 25 May 2017 03:34:11 -0700 (PDT) X-Gm-Message-State: AODbwcAaud3sY+LGS+XHWcxlIGRDbA2W+cJJSepBUkahlgixJ40DVu7J hAal89Y0/kmVNQRUH6BRP5/DL+it0w== X-Received: by 10.223.139.89 with SMTP id v25mr14364396wra.51.1495708450886; Thu, 25 May 2017 03:34:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.131.97 with HTTP; Thu, 25 May 2017 03:34:10 -0700 (PDT) In-Reply-To: References: Date: Thu, 25 May 2017 12:34:10 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Nikita Popov Cc: Fleshgrinder , php-internals , Ben Ramsey , Marco Pivetta Content-Type: multipart/alternative; boundary="f403045e9be2e71d28055056c270" Subject: Re: [PHP-DEV] [RFC] [Discussion] UUID From: michal@brzuchalski.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --f403045e9be2e71d28055056c270 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2017-05-25 12:14 GMT+02:00 Nikita Popov : > On Thu, May 25, 2017 at 12:05 PM, Fleshgrinder > wrote: > > > On 5/24/2017 10:12 PM, Ben Ramsey wrote: > > > I'll take a look at the patch soon. If this is accepted to the core, > > > I'll probably add an adapter to ramsey/uuid that wraps this > > > implementation. The point of the "over engineering" there is to provi= de > > > choice. Some users want to generate bytes from sources other than > > > random_bytes() (i.e., libsodium) or encode UUIDs in different ways > > > (i.e., ordered time). A UUID generator in the core will only help to > > > improve ramsey/uuid, providing more choice and better performance. > > > > > > I may split out the less-used adapters and codecs into separate > > > components in version 4 or 5 of ramsey/uuid, though, since most users > > > don't need anything other than the default. > > > > > > -Ben > > > > > > > Yes, exactly. > > > > The provided implementation does not have any of the options your > > library offers. There are no special formatters, no accessors for e.g. > > time (not applicable to v3, v4, and v5), no RNG choices, no mutability, > > ... well ... nothing. It is just a straight UUID implementation. > > > > I also hope that this implementation will help to get rid of uniqid at > > some point. > > > > -- > > Richard "Fleshgrinder" Fussenegger > > > > I'm wondering if just adding a uuid_v4_create() function (directly > returning a UUID string) might not cover the 95% use case here. My genera= l > impression is that that's what people are usually interested in -- parsin= g > UUIDs etc. seems to be a rather niche concern. > > Nikita > I've looked on `Ramsey\Uuid` usages in `prooph/event-store`, `prooph/common` and also `broadway/broadway` with `broadway/uuid-generator` - most of use cases is generating UUID and dumping to string and to bytes. But there is sometimes used UuidInterface not mentioning this interface functions, creating Uuid object guarantees the object is valid UUID which is not true while using string dumped UUID generated using functions like `uuid_v4_create()` there's need for additional check if given string really is a valid UUID - which is not needed while using specialised object. --=20 regards / pozdrawiam, -- Micha=C5=82 Brzuchalski about.me/brzuchal brzuchalski.com --f403045e9be2e71d28055056c270--