Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117988 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 57446 invoked from network); 17 Jun 2022 15:40:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jun 2022 15:40:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ABC5B180546 for ; Fri, 17 Jun 2022 10:28:23 -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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 17 Jun 2022 10:28:23 -0700 (PDT) Received: by mail-yb1-f173.google.com with SMTP id l11so8313085ybu.13 for ; Fri, 17 Jun 2022 10:28:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=colopl.co.jp; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4Cv+bf44+2P/B/4M2WQ+3e0nO7fQQRGJBNqMrtpVkCk=; b=FnNdCIqEANbt4AfGjE0c6oc+RVOYTUBqHKJ7nE89qd0BNwrs1awxjNF5N4ifWxKn1H 7DzeOr7MtYokEF7fofljrLIFx3/2smAfbEX09z8UD8wmQSbNifL7fbnJVe0ryBNZW4RI hklkh7V+bYurMEF5hTXbrZsWP42OQ3CYVdJL+JCqXk5SGIFmfmpHNwXdadjJlpmcaUl+ uLl63QsGiiNNyoARSPR/08xauJLhygKOMVq7Un+bMvHUnhxyG4eBp5i83NDshIKxXy+J PQEKQEkAfV4wQgyL8vF8uT5kwnWd7/b7dwa1nOASaSLll1DS0Wf+28iOR+PZFKa70Biw qRdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=4Cv+bf44+2P/B/4M2WQ+3e0nO7fQQRGJBNqMrtpVkCk=; b=wfy5fMt6D8OHCzz+kRrZSHeHkCu0SPRI3tycv+34bkXkKE0I45P6rgjo2Tvb7UoWLd 9rEHcnlP7bWBvahJm5sQ0orNf2mEzByvkaSSO/56YVgjlBQmAQ5DA8Yj09mIatUKRuK5 zZczeitGHaWJWY/8U2cp0FLJ6A7ziDXMzLoTpgFQg0+L1Lm5x7hyniOjZI49B4dtCkjL 8xfQeYfx8yeU/VcAQBlvhkjQQmKqpuLg5F1MmPbNHxe4LuKni5txLXLMeswXA/3Y6x8X 7STWkWSBBKjytC8c+vDVl1B2W09UTQOUuGGytWzD4+h3WcTLwtjKVAi5LeI54K2NKLKh R/zQ== X-Gm-Message-State: AJIora9AeDhLisIOEF4cpuikMpqwumEjbsFJKloz5q+VodcRx+QKM7FE es1NZZAVzd5szp/Ya0PFb5DoF/NBplpTjfY14hgV X-Google-Smtp-Source: AGRyM1v/C5F5J4jEe1pLyxGmvmrqXyp1Dd4Cs5mv4ZD1Z+wxKyhVQA4Qvk5XM1E4ZKh+zscH1lnBs5kzONdR2SFfgWE= X-Received: by 2002:a25:77d8:0:b0:663:5e85:a632 with SMTP id s207-20020a2577d8000000b006635e85a632mr12610303ybc.375.1655486902619; Fri, 17 Jun 2022 10:28:22 -0700 (PDT) MIME-Version: 1.0 References: <77a64074-875c-cfd6-5811-24b9d445f550@bastelstu.be> In-Reply-To: <77a64074-875c-cfd6-5811-24b9d445f550@bastelstu.be> Date: Sat, 18 Jun 2022 02:28:11 +0900 Message-ID: To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= , internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000c2e49005e1a814a5" Subject: Re: [PHP-DEV] Re: [RFC] [VOTE] Random Extension 5.x From: g-kudo@colopl.co.jp (Go Kudo) --000000000000c2e49005e1a814a5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2022=E5=B9=B46=E6=9C=8818=E6=97=A5(=E5=9C=9F) 2:14 Tim D=C3=BCsterhus : > Hi > > On 6/17/22 19:04, Go Kudo wrote: > > RFC has been updated. Includes corrections to areas pointed out by Tim > and > > changes MersenneTwister to MT19937. > > I also made it possible to vote for each item. > > I suggest to split the "PCG is not so famous" vote into 2 votes to make > it clear how exactly the majority is calculated and to have a clear > primary vote as indicated in > > https://wiki.php.net/rfc/voting#required_majority > > > https://wiki.php.net/rfc/random_extension_improvement > > > > How about it? > > > > for Tim: > > > >> I believe you missed my suggestion (4) > > > > My apologies! I had completely missed that. > > That new feature sounds good to me. But, I think the method name > > `pickString()` would be better. (It is interoperable with > `pickArrayKey()`) > > I don't think that ->pickString() is a good name, because it is not > really comparable to pickArrayKey(): pickArrayKey() will return each key > only once. It is more comparable to: > > substr($r->shuffleString('0123456789abcdef'), 0, 6) > > My proposed ->randomString() must be able to return a character multiple > times. > > If you don't like ->randomString(), I have an alternative suggestion: > ->stringFromCharset() > > Best regards > Tim D=C3=BCsterhus > > "PCG is not so famous" vote into 2 votes My apologies. This is a complete mistake. Since PCG64 has already clarified its implementation in an earlier RFC, removing it does not seem to be an option. The item has been removed. > I don't think that ->pickString() is a good name I see. But I think `randomString()` is ambiguous with `getBytes()`. `stringFromCharset(string $string, int $num): string` solves that, but I think it is possible that the meaning of "char" is not well known in the PHP world (although I think this name is most appropriate) How about adding an optional `?int $num` argument to `shuffleString(string $string, ?int $num): string`? Regards Go Kudo --000000000000c2e49005e1a814a5--