Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99154 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37156 invoked from network); 24 May 2017 18:02:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2017 18:02:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 212.232.25.162 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 212.232.25.162 mx206.easyname.com Received: from [212.232.25.162] ([212.232.25.162:55333] helo=mx206.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/8E-10292-79AC5295 for ; Wed, 24 May 2017 14:02:00 -0400 Received: from cable-81-173-132-37.netcologne.de ([81.173.132.37] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1dDaba-0000Uf-93; Wed, 24 May 2017 18:01:56 +0000 References: To: php-internals Cc: Larry Garfield , Levi Morrison , lists@rhsoft.net, remi@fedoraproject.org Message-ID: Date: Wed, 24 May 2017 20:01:35 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="x6a4fai2fuseMXMQ3JBrUE1TCsqL29Egd" X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] [RFC] [Discussion] UUID From: php@fleshgrinder.com (Fleshgrinder) --x6a4fai2fuseMXMQ3JBrUE1TCsqL29Egd Content-Type: multipart/mixed; boundary="PDlJ00m5k5H6QGSpE9qSHqLacvEixvcnH"; protected-headers="v1" From: Fleshgrinder To: php-internals Cc: Larry Garfield , Levi Morrison , lists@rhsoft.net, remi@fedoraproject.org Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] UUID References: In-Reply-To: --PDlJ00m5k5H6QGSpE9qSHqLacvEixvcnH Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 5/24/2017 5:11 PM, Levi Morrison wrote: > On Wed, May 24, 2017 at 9:04 AM, Larry Garfield > wrote: >=20 >> It doesn't have to be a PECL library. I agree that a project requirin= g a >> PECL library greatly limits its potential reach, but with Composer >> user-space libraries are totally easy to install. There's a nice and >> popular UUID implementation already: >> >> https://packagist.org/packages/ramsey/uuid >> >> Note: That doesn't mean adding UUID functionality to PHP core/standard= lib >> is a bad idea; discussing that is fine. But the "no one will be able = to >> use it otherwise" argument is substantially less compelling than it wa= s >> even 5 years ago. >> >> --Larry Garfield >=20 >=20 > By the way there already is a PECL package for a UUID library: > https://pecl.php.net/package/uuid. I would like to see compelling reaso= ns > why we shouldn't rally around that package. >=20 What is wrong with `ramsey/uuid`? Well, absolutely nothing. I personally would consider it over-engineered, but that is no real reason. My implementation is after all not an attack on a well maintained Composer package. The fact that this package was downloaded almost 10 million times however is an indicator that that functionality is required a lot. What is an STD for? Exactly, to provide things that are needed everywhere. This is exactly the reason why I want to see UUIDs as part of PHP's STD. What is wrong with PECL's uuid? Of course I know about that package. The problems I have with it are simp= le: - It just exposes a C API to userland, without considering that PHP is becoming less and less procedural. - It is not type-safe: - its own functions aren't, and - its generated values aren't. - It works around existing PHP implementations by adding a new dependency that is Linux only: - no Windows - no BSD The implementation I am providing is extremely simple, and makes use of existing PHP functionality: - It works on any operating system that PHP supports. - A change to `random_bytes` directly upgrades my UUID implementation. - The same is true for MD5 and SHA1 (unlikely, but hey). - It has zero outside dependencies. - It is extremely type-safe. - It has a well though through object-oriented API. - It supports serialization out-of-the-box without extra effort because I use, once again, the built-in PHP stuff. - It supports comparison out-of-the-box without extra effort because I use, once again, the built-in PHP stuff (no overloading!). Of course, you guys can disagree with all of these. However, the implementation is extremely trivial. Almost everything is just PHP API code. The only thing that has actual real logic is the `parse` method, but that code is trivial too (just have a look at it). --=20 Richard "Fleshgrinder" Fussenegger --PDlJ00m5k5H6QGSpE9qSHqLacvEixvcnH-- --x6a4fai2fuseMXMQ3JBrUE1TCsqL29Egd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZJcqIAAoJEOKkKcqFPVVrn3gQAL9ycPkPrRhij9DFS4IF9zT7 HtGkr6j9KlZUXyYcR0vIUAGppx4Ya0iPp3aZNtIDJyFFROs+PVA6zRDmJaOaAXoB vGoh2SDCAWrk7FJ9i9Dyen/6im86uvzUM9OuGNyCXpNPzpDL8oNl13tNLFAgp7Cn AyXykpPGtErXmCvTifa0bJjRnL9CPjQqmCsa5vK2ZYAFTDgyeS3cwPR2mZPR5gmU RGOm2BPY8UYwHuh4Qpx3zXYBO+vtL71wLquaZELWv3qBb/tOijlI3oAJ0r1RYc4Z +Qk7Vg7o7TRQKfO6ENp05LtExw16vfkwlvLRG+bZh6GxD2EYcucU47JvbjcD2K3o 4hGDEHQoc2/TWPR6fjHRuFy+QU/4dUwvQ+z7uqiBTDhZ8BlEtgo02r410O+T8arx BOmeXNd2xZ+Pcr+36hbyh3BoYi1JUVS3oZAGx5TlJiSdhFe+BM2Q3yX78IxyhJm5 UUyDMyo14gTLFq+Jhzs4BnJ4kidhpkX++G08t0y15WN8yW33Y+q7nHYD/4qOb3Ub XSwb2+nQFjEKtXQHn0gDf+ITTrgZ/Y7eMpIxw1RZvey80KnJJAegzY+Q+fNEOalT kKgrVNeS46bVnK25UoK7+vynSsT5jztYlbxaJtg1gxo7Wvb7KCnBVARK5ukw8/WU 8Q5Y3HxKhYHLOVbv3zZt =y5Uz -----END PGP SIGNATURE----- --x6a4fai2fuseMXMQ3JBrUE1TCsqL29Egd--