Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118052 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29786 invoked from network); 22 Jun 2022 13:13:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Jun 2022 13:13:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ED1DA180549 for ; Wed, 22 Jun 2022 08:02:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 22 Jun 2022 08:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1655910171; bh=bWQj4S4w1ad4BRkSIG8p5h0IAUQSAFx2nnHhiZaqK2g=; h=Date:Subject:To:References:From:In-Reply-To:From; b=aR9NFRAtueNR1i6eVUcrPRUgVKC6RQzchIX6TAemFsyk89q/zqSRoM11+2BqCpuk0 J3HbZrtkqNCtdmbakYOoDKiwd0WG7FOD9bnO3oL9gYK0ejxmHUN/FjdySWsaF+Ocl4 bw0R+vYE5ra8poRe/w0gnJ3j4CQb/SVHoIhIqL2wHR6gaL9jZ+0ZDHrn+wFDhQ0QHj Az2BIiPD+EQ7zOMtwVnUSrNooud5AI0blPmGsHfykUHL/0HyVoc+xZkPdy6trGj0Sd XO2MgdX364M2Mas9crRFYTzroeNI8MIAIUS4026/UC0Yo0nb3IUEYqHcpgQREMl2XU WOzh3trgdN3lA== Message-ID: <2dde46be-bc0d-b0dd-90d9-1128757cfe82@bastelstu.be> Date: Wed, 22 Jun 2022 17:02:48 +0200 MIME-Version: 1.0 Content-Language: en-US To: Go Kudo , Go Kudo , PHP internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] [Under Discussion] Random Extension Improvement From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi On 6/22/22 16:35, Go Kudo wrote: > No additional comments seemed to be forthcoming, so the RFC was upgraded to > 1.5. > The following changes have been made > > https://wiki.php.net/rfc/random_extension_improvement > > 1. Add: `Refine classnames` > 2. Add: `Random\SerializableEngine is outdated` > 3. Add `Add Randomizer::pickArrayKeys(array $array, int $num): array > method` *1 > 4. Add `Random\SerializableEngine is outdated` > 5. Remove: `PCG64 is ambiguous` (replaced by 1) > 6. Remove: `Mersenne Twister is ambiguous` (replaced by 1) > 7. Remove: `Randomizer lacks array_rand() replacement method` (replaced by > 3) > > *1: Added with a little sample code. Thank you for the update. The grouping makes sense to me and it looks very organized. Let me just propose some wording changes: a) > Random\SerializableEngine is outdated I would rename the headline to "Random\SerializableEngine is not useful", that's a little more fitting. b) > CombinedLCG is outdated I would rename the headline to "Random\Engine\CombinedLCG is low quality", that's a little more accurate. c) In the "Refine classnames" section: > To make it more readable and regular, the class name is changed as follows: I would reword this as: To clearly identify the implemented algorithm the PCG64 and MersenneTwister twister engines should be renamed to their canonical upstream name: The issue with the previous wording is it's not clear what "more regular" means. d) For the vote titles I propose the following changes for a more consistent wording that succinctly describes the change to avoid voter confusion: Engine implementations to final to Make all implemented engines 'final'? Remove Random\SerializableEngine to Remove the SerializableEngine interface? Drop Random\Engine\CombinedLCG to Remove the CombinedLCG engine? Add Random\Randomizer::pickArrayKeys(array $array, int $num): array to Add the pickArrayKeys() method to the Randomizer? Rename Random\Randomizer::shuffleString() to Random\Randomizer::shuffleBytes() to Rename Randomizer::shuffleString() to Randomizer::shuffleBytes()? Change classnames to Rename PCG64 and MersenneTwister? Implement Random\Engine\Xoshiro256StarStar to Add the Xoshiro256StarStar engine? Best regards Tim Düsterhus