Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94239 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91172 invoked from network); 23 Jun 2016 20:37:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2016 20:37:43 -0000 Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.89 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.89 mx108.easyname.com Received: from [77.244.243.89] ([77.244.243.89:54652] helo=mx204.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/D2-08667-6984C675 for ; Thu, 23 Jun 2016 16:37:42 -0400 Received: from cable-81-173-134-219.netcologne.de ([81.173.134.219] 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 1bGBNM-0004ec-5S for internals@lists.php.net; Thu, 23 Jun 2016 20:37:24 +0000 Reply-To: internals@lists.php.net References: <2f92fa26-5f50-0e68-c1fc-de79f17c201e@fleshgrinder.com> <8b48f847-bbba-03f8-4b2e-9cd0841b484e@gmail.com> <65ea0142-c2d6-f4ed-e98e-b7c7fbc51c58@fleshgrinder.com> <0e4655b3-d0cb-f1cc-6e39-c336ed51e2de@gmail.com> To: PHP internals Message-ID: <5503989d-0a9a-7bb5-465e-b0f6407657d0@fleshgrinder.com> Date: Thu, 23 Jun 2016 22:37:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <0e4655b3-d0cb-f1cc-6e39-c336ed51e2de@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3p1VV5xJN6tEWxHowCEpNdE4Qb0trS6pP" X-ACL-Warn: X-DNSBL-BARRACUDACENTRAL Subject: Re: [PHP-DEV] [RFC] RNG fixes From: php@fleshgrinder.com (Fleshgrinder) --3p1VV5xJN6tEWxHowCEpNdE4Qb0trS6pP Content-Type: multipart/mixed; boundary="IcAwcKx3TEtLbUqlv3DKDQquDJo42Gqom" From: Fleshgrinder Reply-To: internals@lists.php.net To: PHP internals Message-ID: <5503989d-0a9a-7bb5-465e-b0f6407657d0@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC] RNG fixes References: <2f92fa26-5f50-0e68-c1fc-de79f17c201e@fleshgrinder.com> <8b48f847-bbba-03f8-4b2e-9cd0841b484e@gmail.com> <65ea0142-c2d6-f4ed-e98e-b7c7fbc51c58@fleshgrinder.com> <0e4655b3-d0cb-f1cc-6e39-c336ed51e2de@gmail.com> In-Reply-To: <0e4655b3-d0cb-f1cc-6e39-c336ed51e2de@gmail.com> --IcAwcKx3TEtLbUqlv3DKDQquDJo42Gqom Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 6/23/2016 6:56 PM, Stanislav Malyshev wrote: > Hi! >=20 >> I would prefer something like random_fast_int() =3D=3D mt_rand() =3D=3D= rand(), >> with clear documentation on when to use random_fast_int() instead of >> random_int(), and a note on the others that "since 7.2, mt_rand() is a= n >> alias for random_fast_int()" etc. (Not wedded to the name >> random_fast_int, we can bikeshed that later.) >=20 > That sounds to me like a good way to proceed too. I don't think it's a > big deal it mt_rand won't be using specific MT algorithm anymore, I see= > very small number of places where it would matter. >=20 > One thing to consider is that there might be test scenarios, sequences,= > etc. that depend on specific seed and will be broken by changing the > implementation (tests relying on specific rand are not the very best > idea, but they do happen), but I think this kind of thing may be > acceptable for a major version. Would like to hear thoughts on this tho= ugh. >=20 +1 for the introduction of a new function that is named similar to random_int() but clearly distinguishable followed by aliasing in PHP 8 of mt_rand() and rand(). The agenda would be: 1. Decide on a signature for that new function. 2. Decide on a name for that new function. 3. Decide on an algorithm for that new function. 4. Implement it. 5. Update the documentation or rand() and mt_rand() to mention the plans for aliasing. 6. Alias them in PHP 8. Nice to see that we come to something that satisfies everyone. :) --=20 Richard "Fleshgrinder" Fussenegger --IcAwcKx3TEtLbUqlv3DKDQquDJo42Gqom-- --3p1VV5xJN6tEWxHowCEpNdE4Qb0trS6pP 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 iQIcBAEBCAAGBQJXbEiHAAoJEOKkKcqFPVVrUnkP/1q9Je2FAZbCuPjcxKsedzqL 4ZUf3m/VsIcnXk+Tq00GY3D6jG/GkeuE+I7I9/4um9X7nuiBcNlN5U9S26MAbcnE xO/IjMqS9pcxO7lgMd3fv0PuCV8igjR0ZvulJTH1g8Pu1S/habtnT1kSvpzE2Y98 CbJQ4OzJRSGAEgLGe1Yeli8xSK0DamnBP0tgBLVyfhY7aoDh5vIRNikAuo8rOUIJ GKp67cI12yY9PvifDWAnrkgoZkjmtHOhaxWACiSO6XRQYV6tMfSuSLCOnrWzJutA znbVsZYFf5wyTW8STRdFYJ7qkqYlbdPSSYz+KCgqsNPnZKE9qj8TCSOKIfU9OhDr Wk+Sxp9nM5TRuR45TkgsiZm23puGjArOVnn+Iz8dPG6GNLEzCWt4A7h9AlsiH+ac nhaV1AJfTZy0fnUSRKoTyh3z6c+QIJRxmb6XcF7ByxDEICtrsoqumYRabn0SToBR Q1R355d6a0NiWcDUzFyxoilCmXK6jj8OrFO6etotGRjNwLtSmtDwyrisZ5UzQVtd 33qOXa5xEXFug836fHDWI0ioHWRpEJ7cw5RB8qMwpDjQxn3A0IMSiG9D3WCWQb6s 93THF5GQb0g7QacNaGmkVbjiAR8LaMQVeUIqdRsVzV2LbjNcFX4NkOGvLVRwECaz z9nKjRCjGxMamiRJ2bO/ =vstl -----END PGP SIGNATURE----- --3p1VV5xJN6tEWxHowCEpNdE4Qb0trS6pP--