Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115936 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36986 invoked from network); 3 Sep 2021 15:26:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Sep 2021 15:26:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E75C1180511 for ; Fri, 3 Sep 2021 09:02:41 -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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 ; Fri, 3 Sep 2021 09:02:41 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id l18so10280180lji.12 for ; Fri, 03 Sep 2021 09:02:41 -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 :cc; bh=4jzM6J1txOKsGs4xUrxqhdXe2CMiLPh8yIZNFAqdg6w=; b=mrJ06nsyaTTMb88oZBusJf7TBQKnAXpXSQy44JEgVzSAjdE1IagHDswNqBALEUSMlh 6+d6mTSyJQo/7/ETqdTJR19d8FQ4DDmzI8ETnTroz6z7s7EgvueT43tMrXiGN9AlsCVi zKlP+0dK4zt6djOANvgFGiI3WDfUxOxZj3A5FOPoxJLYEAa0b0K67chWaVcGC6a4dtos d7R8X1EZiHZasi0ZJN3z84bMQbN5+9YW2FrtVvz30VjgV0Wn9wm/JW8KNCwhYK75g93/ /ut9s9X4G7FvSVF/TEgQCPbupu5a+e4n7iPyflB9D6/UBJkPtcBiCnqg4hGHeAUFRIqS tvpw== 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=4jzM6J1txOKsGs4xUrxqhdXe2CMiLPh8yIZNFAqdg6w=; b=lb5lTsaYwaFhGfaxt/dFDZC6asYyXWN5msyH7T/UuleT9gHMjME/DZ+lneq1jprcEo Zzn3ExCjF9NaQ/iWaiZ9tkN+hRDjAgqLOBDtWaa73kHZEE86Gp+IyrJUrEusYn0Bvdan dSf4aRP7jOW/yK09XYbjE7UurbpuZ7PL8gyrMdN9Eg44hTq+4fG1GAnNQeFyVR2sjYBF p9deXJbSeXip+KO1bGOAGmCMGZv+Vxv/bK2ML7ImjV6GzpVYuwfW5K7yrXQdboXY1EEX 1PAt78E/Im5rxwvFF5HyB/J6M0oAfycz4OVDUCx3Q5YVtRn2Ws6Wzdlg8kFGKVMNlp/U kPUQ== X-Gm-Message-State: AOAM532+27D35qSUhbjg/ijrb+Fv/g90Py69nduBRX9jKfGNwMqt3BcV GG8LaqP1u9Q7uaH+4JTRCq/vWESAx32aElIIAaA= X-Google-Smtp-Source: ABdhPJxruLLGTY26tOwNrOs1pbi4bSrmPHCC3hamkMP/z/wK3FoEI7fpclXevsmf0MIN8GNLlkJIQVLni0laGFY+YFo= X-Received: by 2002:a2e:a7cd:: with SMTP id x13mr1174571ljp.515.1630684959005; Fri, 03 Sep 2021 09:02:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 3 Sep 2021 18:02:23 +0200 Message-ID: To: Go Kudo Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000b8e5a705cb196d43" Subject: Re: [PHP-DEV] [RFC] Random Extension 3.0 From: nikita.ppv@gmail.com (Nikita Popov) --000000000000b8e5a705cb196d43 Content-Type: text/plain; charset="UTF-8" On Thu, Sep 2, 2021 at 5:10 PM Go Kudo wrote: > Hi Internals. > > Expanded from the previous RFC and changed it to an RFC that organizes the > whole PHP random number generator. Also, the target version has been > changed to 8.2. > > https://wiki.php.net/rfc/rng_extension > https://github.com/php/php-src/pull/7453 > > Hopefully you will get some good responses. > This looks pretty nice to me. A few bits of feedback: * Unlike the previous versions of the RFC, this one also moves all of the existing RNG-related functionality from ext/standard to ext/random. Why does it do this? This doesn't really seem related to the problem this RFC is solving. * Regarding the abstract class Random\NumberGenerator: You currently need the abstract class, because php_random_ng is tied to the object. An alternative design that would allow Random\NumberGenerator to be an interface would be to make it independent of the object, such that the structure can be allocated in the Random constructor for userland implementations. Of course, internal implementations could still embed it as part of their objects -- just don't make it a requirement. * The future scope mentions: "Changes random source to php_random_int() a shuffle(), str_shuffle(), and array_rand()". I don't think it makes sense to switch these functions to use cryptographic randomness by default... Regards, Nikita --000000000000b8e5a705cb196d43--