Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114527 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 85306 invoked from network); 20 May 2021 06:43:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 May 2021 06:43:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 079CD1804BD for ; Wed, 19 May 2021 23:53:26 -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_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 19 May 2021 23:53:25 -0700 (PDT) Received: by mail-ej1-f47.google.com with SMTP id l4so23501349ejc.10 for ; Wed, 19 May 2021 23:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8Bg7yNBKEeoZht7b6+npPmF8n0D9izaJyKWxfmTJzVU=; b=o2u79CjP15M/Xc3AQIagPMCdiwxAnNnIgfCO7NR8SvPWF2eRBX0ljfH2SmhtRiIaP9 FjfHo2/annYz5mPXhZBQ36tOxg23h5L1jJP/ov10ssrBejyNdkIR54+au9mpSBO2liM4 LfhFzhDvJtf4IHOOJAwc4pMzaCShdCMiHRBTrPujWIfyAl+/B4uerER3gXBNqVi5imrG /nswElKHJNSjcQO2jcuZDTyxTBLhP+Ycd4ApzEszDuEkfKMcMM0BCJAI1WDz/fefpbk2 1Bna2TkmslBX0rgnRaWO3cABN8NVH9CvQiy1HndmR2ziD7HIHdqOU3wESz0MlxYKW0J5 CJYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8Bg7yNBKEeoZht7b6+npPmF8n0D9izaJyKWxfmTJzVU=; b=Cqk5c7u+55tM4PWtIe3qk0N/VGGCB6dme5GJD72Tl+opFjWeVw0jo+gbBzoakWKHYr bKMys/BxcywAnwlSV1gxe90LgJP0CmAKfM1yVfg+/KAMQF0M9d2TevAmAg6Z+lOiiH1I 6O72/d3/5ANxyvFcarredLqnQVlntLKl2BAKiR12T7co7a1VTz1Y49HROFkrdRJekLjQ n7EJDiM2xvb3ZCkOuTIXjI3EwAdS3tEZXGEJmj1vIEwgPVUB+A7g2Nv4IBvadLDOVjuS +o6H0SM8V2NP4yq03Azsu0Ed2BYrY3oBYetP1nglYWP0g6TyoxKccYe9AqPnkGJfT0nO 3HKA== X-Gm-Message-State: AOAM531yf/FTzEtkdFWjFIJWj6f3Pk4Q954ydh36heiPqkjGWn2ua4am 2O58Oe1Y1nxxZ7CmLFqsQGqS51Gz6IQGsM1UnpE= X-Google-Smtp-Source: ABdhPJzAS6/QkhyXGLeSQE0Qf9g48zO0oqStBm6f0wc9jOkK5mgmzjy6aKwrxhUByQlGDH+Xgki0g3LROZ650+8U9A8= X-Received: by 2002:a17:906:aac8:: with SMTP id kt8mr3070926ejb.402.1621493604262; Wed, 19 May 2021 23:53:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 20 May 2021 09:53:07 +0300 Message-ID: To: Go Kudo Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000049a9f705c2bd6643" Subject: Re: [PHP-DEV] [RFC] [Draft] Add RNG extension and deprecate mt_srand() From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --00000000000049a9f705c2bd6643 Content-Type: text/plain; charset="UTF-8" On Tue, May 18, 2021 at 7:19 PM Go Kudo wrote: > Hello internals. > > I have created a draft of the RFC. > > https://wiki.php.net/rfc/rng_extension > > This RFC is a proposal to implement the old object scope RNG in PHP. > > You can read about the discussion so far below. > > - https://externals.io/message/114378 > - https://externals.io/message/112819 > > I believe that the problem with the previous RFC was that it was just an > ugly API. I propose to sort this out and deprecate the existing functions > that should be replaced. > > I would like to ask for feedback on this draft RFC. > > Regards, > Go kudo > This looks good. 1. instead of ext/rng and the RNG namespace, why not use ext/random and Random namespace. And incorporate also other random_* functions maybe by creating some aliases. 2. instead of Randomizer, maybe we can use just Random or RNG (if previous suggestion does not stand). 3. maybe some helper functions like Random\new_random($algo, $seed): Random\Random can be used as a factory for internal implementations. Or RNG\new_randomizer ($algo, $seed): RNG\Randomizer (if previous suggestions does not stand). 4. for public function next(): string, how many bytes should be returned? Regards, Alex --00000000000049a9f705c2bd6643--