Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118266 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45105 invoked from network); 15 Jul 2022 14:06:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Jul 2022 14:06:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 670DC1804C6 for ; Fri, 15 Jul 2022 09:02:15 -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,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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, 15 Jul 2022 09:02:15 -0700 (PDT) Received: by mail-ej1-f41.google.com with SMTP id j22so9761205ejs.2 for ; Fri, 15 Jul 2022 09:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=vkuopcS5Gdkn/5G3AgvSLalLYWlw5gRoaxFS/4TtynM=; b=ni2s22BYC3BwGF8h9oRLyfCetrl+c19UQiAIxtkXYaXStn9ZhZWHJS56Qh0+aHjDXw 7GMds2PANESWOya2TnAoLk3NBp1IB6vzeID1sxKejXcRjkSJKLSo0ug55bCgmNttJiPv CL/3U2q2/NrYb/GcoRUv0ilUyd0Tl/+tlhMVYoAQ+BtEUkVP9vERBl3OKCD1a2OC4z1v N2DYGraB6EYxpLJ8Lhcd4E9kAUldBUGUr1rayEsj6/ZKrtL1bom5AlSymh3r0rqNK27p V/iYzge+YSQyswR434nremNon9j94eB5PK8DH1hmI/gjForlcvjQkl1GMC3QAoN7qB80 mJjA== 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=vkuopcS5Gdkn/5G3AgvSLalLYWlw5gRoaxFS/4TtynM=; b=XZ2Jxe9ufor2ovW5zTNPF/+tygrTiwEkht0RLS3y48DoDWI6nY75SeCW1GGtHPJUEH nmvkVhfmvxTixXITzVb156xIR9ieEGwfcyqYVvm44FuQbK/x4AqhuSAcT556C322pr/g 44CHoyrp+jPdakeVhKt9xcA/ayAV9I2YTwPV0dkTt9yOpeif7p8miOexT9Clsnr9CR5X cswFILledj0DRmwfRLSGpkyOGMuxECZgQ57Td3GtTgm5X3YaSiD7gp2fiSt3ORw7llJV dBdnnk/MUfJlcONNjkr8y9KRICGEG8n2rj20xNnhn7YVimgH93ItAyGnCuEZyaB/iDWN 2+OA== X-Gm-Message-State: AJIora8Fx2CnhyPj9GE+H9n2Z0SFWEAe4TbIvdmWQjrSv9JQvhAuVTTp BL+U3TkH3MtVDOV/W43OK8eyGdTZwkvISlh0waw= X-Google-Smtp-Source: AGRyM1sqm/rQE8qN2W6lzvMyM/0M6JDHJfSTU1/8UhR3tR4dP9WYgqSWyiVHXNeKcPDg7exdHV1qxdwdfz7i00bST1o= X-Received: by 2002:a17:907:96a4:b0:72b:647e:30fd with SMTP id hd36-20020a17090796a400b0072b647e30fdmr13888929ejc.723.1657900933791; Fri, 15 Jul 2022 09:02:13 -0700 (PDT) MIME-Version: 1.0 References: <5ECCFE96-8C0E-428B-9C18-F30B724BD8D5@gmail.com> In-Reply-To: <5ECCFE96-8C0E-428B-9C18-F30B724BD8D5@gmail.com> Date: Sat, 16 Jul 2022 01:02:02 +0900 Message-ID: To: Claude Pache , Guilliam Xavier , PHP internals Content-Type: multipart/alternative; boundary="0000000000003b44d405e3da24e9" Subject: Re: [PHP-DEV] [VOTE] Random Extension Improvement From: zeriyoshi@gmail.com (Go Kudo) --0000000000003b44d405e3da24e9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2022=E5=B9=B47=E6=9C=8814=E6=97=A5(=E6=9C=A8) 16:14 Claude Pache : > > > > Le 14 juil. 2022 =C3=A0 06:32, Guilliam Xavier a > =C3=A9crit : > > > > On Thursday, July 14, 2022, Go Kudo wrote: > > > >> 2022=E5=B9=B47=E6=9C=8813=E6=97=A5(=E6=B0=B4) 1:10 Tim D=C3=BCsterhus = : > >> > >>> Hi > >>> > >>> On 7/12/22 18:04, Tim D=C3=BCsterhus wrote: > >>>> I also think that both '$string' and '$binary' are appropriate > parameter > >>>> names in this case, so particular preference from my side. > >>> > >>> Sorry for the follow-up, there's two mistakes in that sentence. It > >>> should read: > >>> > >>> I also think that both '$string' and **'$bytes'** are appropriate > >>> parameter names in this case, so **no** particular preference from my > >>> side. > >>> > >>> Best regards > >>> Tim D=C3=BCsterhus > >>> > >> > >> Hi > >> > >> I agree with you. I will change the parameter name from `$string` to > >> `$bytes` as I don't see any problem. > >> > >> I will try to explain the changes more rigorously in future proposals. > >> Thank you. > >> > >> Regards, > >> Go Kudo > >> > > > > Hi, > > > > I was waiting for more opinions but... so here's mine: > > > > I would prefer to keep "$string", as [that's how I read the RFCs, and] > when > > calling e.g. shuffleBytes('foobar') I don't feel like I'm passing "byte= s" > > (or "a binary") but a string (to be shuffled byte-wise rather than > > character-wise or codepoint-wise, but that's from the function, not the > > argument)... > > Granted, not compelling, and probably won't matter in practice, but hey > ;) > > > > Regards > > > > PS: sent from mobile > > > > > > -- > > Guilliam Xavier > > I agree with Guilliam: this function is about =C2=ABshuffling the bytes o= f the > given string=C2=BB (as opposed to, say, =C2=ABarray of ints=C2=BB) > > As precedent, there are `bin2hex($string)` and `md5($string)`, which are > unambiguously working with bytes from data given in the form of string, > where =C2=ABstring=C2=BB is a PHP type, which can hold data that is not n= ecessarily > UTF-8-encoded or Shift-JIS-encoded text. > > =E2=80=94Claude > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > Thanks for the input. This is certainly something to consider. For example, what about the `$binaryString` argument name? I think it is clearer. I have adopted this as the name of the internal API: `php_binary_string_shuffle()`. As stated in the GitHub PR, this implementation probably requires additional changes. After voting on the current RFC is complete, we will again send an email to the ML. Regards, Go Kudo --0000000000003b44d405e3da24e9--