Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112526 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 64372 invoked from network); 16 Dec 2020 16:25:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Dec 2020 16:25:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E8BFA1804C6 for ; Wed, 16 Dec 2020 07:56:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: *** X-Spam-Status: No, score=3.2 required=5.0 tests=BAYES_20, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.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, 16 Dec 2020 07:56:32 -0800 (PST) Received: by mail-lf1-f47.google.com with SMTP id o17so46638192lfg.4 for ; Wed, 16 Dec 2020 07:56:31 -0800 (PST) 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=S5SujUX/gnF7NFIGW6knc5OGSr5lbK9gUTe1+ammTAQ=; b=F769BFx/54kF7m2pfxUDGkzRMqlRBbLhQx6zu/8nnZq7X0Z1u0+NlRvUDY/YcMWoit 10uc1igwjfBIJQgpx1ZOdD0y9x5UsSNAym6yYViaugzRqShtPwMC12NdCo0xSai0kQ1d sDihOCqyDw5dVzMIQkz6wYLqpU2NSqnlpEZQiMg+6ukOC5iSELe2ZBehI2E2IfbZIxB8 iJp1sCUgpKbVr+Jdy/QyISoIk/fRRmuDTjqt1LZkFrGHqvnXmsE7ujEg05EXTH2Z7+m9 dabA0smMlw3SsW/O8Tmq3J964/ZLw1mHZ1Mz2Rxv+C/QiBg7fmvlOcdpUG4IleA8NO7U 27Nw== X-Gm-Message-State: AOAM531l93Hi+gIcbeCkjgtBMikhiDIglunHyFSDqqxpdkPa+ee8sX/a 3GC1V2Ubvk6OAoarr2efJnOavJyIRXlhdN16n9fxuQ== X-Google-Smtp-Source: ABdhPJxho6Dk6YdHt2gBIo8ItmVpinKOSmw/AAZhusPwp6MCEr76SrKLXH6k91VmizRZs/NT6SZeU9WeUWte6MrsC+0= X-Received: by 2002:ac2:44a6:: with SMTP id c6mr13388380lfm.102.1608134188688; Wed, 16 Dec 2020 07:56:28 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 16 Dec 2020 09:56:17 -0600 Message-ID: To: zeriyoshi Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000011807c05b696ebe0" Subject: Re: [PHP-DEV] Improving PRNG implementation. From: pollita@php.net (Sara Golemon) --00000000000011807c05b696ebe0 Content-Type: text/plain; charset="UTF-8" On Wed, Dec 16, 2020 at 8:46 AM zeriyoshi wrote: > Nice to meet you, internals. > Welcome! I'm about to knock down your suggestion a little, but please take it as constructive feedback. > First , PHP has the historical Mersenne Twister PRNG. However, this > implementation keeps its state in a global and cannot be handled as an > object like other languages (e.g. Java). > Can you clarify what object handling provides? Is the intent to have an expanded API for producing a reliably predictable series of numbers based on more finely tunable seeds? Iterable PRNG generator? > So, I created a PHP Extension and proposed it to PECL. > > https://marc.info/?l=pecl-dev&m=160795415604102&w=2 > https://github.com/zeriyoshi/php-ext-orng > Bundling extensions usually comes when an extension has shown widespread popularity/use. With all due respect, this repo is less than two weeks old and has 8 stars. Who needs this and why is it not services by the PRNG and CSPRNG options already available? > With the development of container technology, this problem seems to be > getting more serious. So I think we should use the random numbers provided > by the OS (getrandom on Linux) if available. > We've had that since 7.0: https://www.php.net/random_bytes https://www.php.net/random_int -Sara --00000000000011807c05b696ebe0--