Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118264 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50546 invoked from network); 14 Jul 2022 05:18:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Jul 2022 05:18:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 35D7D1804B5 for ; Thu, 14 Jul 2022 00:13:40 -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, 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-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 ; Thu, 14 Jul 2022 00:13:39 -0700 (PDT) Received: by mail-ej1-f54.google.com with SMTP id bp15so1779931ejb.6 for ; Thu, 14 Jul 2022 00:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=U9/xkFFMVMifj4iB//kEpKmvHTLOyyPdDBtWxwpJSAY=; b=eVVvVAFBmEkl8g1uDDOJ586QYRV2zNSHy/lMYz7uQpYX2zJtVbNfvDeLguukX/AkC9 /wSZX/j1s4/yRnV5XylAeN0THdixOnwsviSdrJgGGqhLyukOskkUsyP2yZo9fplb+vvX mUC9XdLGdczXQFkoW67JQy1Sk7f31aXI93p/pWfaJ2s0qY11hYOgGdXSCTQISkTKkAvx z9g3VfVncRdiO7gjKxxC1Fq/gj8TszfCTtvfisXgbK0jzbkHhnWprlY6DgTBbYDnayDW lDigxMb/BdySDT6PYvw5iUL/3BQElX211nObyymNkimleCEI/sJWGT5Nyj8DeTWtAwZg GF5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=U9/xkFFMVMifj4iB//kEpKmvHTLOyyPdDBtWxwpJSAY=; b=NG4BSKfpA4IX70Ofn9Nwz8KHnvv6sBSnkoQO/vojPAV+SJQWioX4f4rZs8wvxe790+ JZVVhu3T+GZ5eK7oq5V0b7XmbTxkNBpzIqXeISQvCL8kZ8o+J2xxnTzoy1gKfUuTPGEL xzuONpEECgEyeq3/PNflfNmC+mvYC+QljZWo+P/BuLJPR5rO9TbzJ1CiCmLY142TWRxL zaTKyczRdatDltLwCHqeJr+PfPeOCgAD9TamuxAK31Lt1uC5TohU53XGTH6W2tgyV7sg 4Q9oxzEkJ02pd0mAXew3jvWxSWvU1tiJyLNeio0GF1LfeLib0Qcw1Hn9KLvZXeovLnWU Xq7g== X-Gm-Message-State: AJIora+gDnB4vXGI3AA85THP5mLxrFWQtDgf3ViyEu120g7uD1bEWLW5 KK2oEyoXK0lcqZh3zLzbQ6A= X-Google-Smtp-Source: AGRyM1vCADYFcAYWrx7rHW80oHerKQiXm8VI3zq3ya0KGBxeFrgfxt9ntZUcNxDtp885dev9brQK5Q== X-Received: by 2002:a17:907:1ddd:b0:72b:49ff:d39e with SMTP id og29-20020a1709071ddd00b0072b49ffd39emr7295691ejc.500.1657782818581; Thu, 14 Jul 2022 00:13:38 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id kv10-20020a17090778ca00b0072eddc468absm342813ejc.134.2022.07.14.00.13.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2022 00:13:37 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) In-Reply-To: Date: Thu, 14 Jul 2022 09:13:36 +0200 Cc: Go Kudo , =?utf-8?Q?Tim_D=C3=BCsterhus?= , "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable Message-ID: <5ECCFE96-8C0E-428B-9C18-F30B724BD8D5@gmail.com> References: To: Guilliam Xavier X-Mailer: Apple Mail (2.3696.100.31) Subject: Re: [PHP-DEV] [VOTE] Random Extension Improvement From: claude.pache@gmail.com (Claude Pache) > Le 14 juil. 2022 =C3=A0 06:32, Guilliam Xavier = a =C3=A9crit : >=20 > On Thursday, July 14, 2022, Go Kudo wrote: >=20 >> 2022=E5=B9=B47=E6=9C=8813=E6=97=A5(=E6=B0=B4) 1:10 Tim D=C3=BCsterhus = : >>=20 >>> Hi >>>=20 >>> 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. >>>=20 >>> Sorry for the follow-up, there's two mistakes in that sentence. It >>> should read: >>>=20 >>> I also think that both '$string' and **'$bytes'** are appropriate >>> parameter names in this case, so **no** particular preference from = my >>> side. >>>=20 >>> Best regards >>> Tim D=C3=BCsterhus >>>=20 >>=20 >> Hi >>=20 >> I agree with you. I will change the parameter name from `$string` to >> `$bytes` as I don't see any problem. >>=20 >> I will try to explain the changes more rigorously in future = proposals. >> Thank you. >>=20 >> Regards, >> Go Kudo >>=20 >=20 > Hi, >=20 > I was waiting for more opinions but... so here's mine: >=20 > 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 = "bytes" > (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 ;) >=20 > Regards >=20 > PS: sent from mobile >=20 >=20 > --=20 > Guilliam Xavier I agree with Guilliam: this function is about =C2=ABshuffling the bytes = of 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 = necessarily UTF-8-encoded or Shift-JIS-encoded text. =E2=80=94Claude