Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113901 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25189 invoked from network); 1 Apr 2021 10:11:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 1 Apr 2021 10:11:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B746F1804E2 for ; Thu, 1 Apr 2021 03:08:57 -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-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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 ; Thu, 1 Apr 2021 03:08:57 -0700 (PDT) Received: by mail-lj1-f181.google.com with SMTP id c6so139079lji.8 for ; Thu, 01 Apr 2021 03:08:57 -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=tTPhHPfuKfKOQkbcn9yFTj+ZkQu7CkgfgPBR5hZWk6w=; b=UD/Jhm6p1e+Ze/B2ZK0P1voOkjh0AUxT3rsBlQ8hsFXFyeuU+CAZcPEP8FDxA4lHmM bS/1flsoGpggATUEhFogiPxQoTtimaj3lVq0mD4P9lWn+YRM3drYcLmlj+MJKlilR7yw D40eNH/+OpbkU517r4vZL/8+XMK+b1Z3ctkuwSysVsaNSbqb0oYjv94VJawDoKRPcVY4 g91QsOCgkZ6br8lCWxlJy7ZWHEacK9L7uubR0r0Qy2LkxWwb/DVSh8uTwQyOZuhz4TxT k8f2KHL0/LiSt2xw9k3Jx0e+ZZVKxahVDmkJe9p4gVBMat5gQRzzZd4BJxaEebaMuUIB PSow== 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=tTPhHPfuKfKOQkbcn9yFTj+ZkQu7CkgfgPBR5hZWk6w=; b=PhOHbonIA0sfc8zC9RPSP3ovhxgk66ZQDqO04ZyPPWWAZtdsUBeHTOEvUAczvKF8si E+unDkDdw+3lYQK2s5qO6Budu+iBRsmL9OXUaNrJOxzgUIu+9ZSVktAeOs947Z3Xr1RG 0+Day+s1sC5n9igyUavxe9zhXawta3Zf5GeFcraAy9u81tdYps7NycxPQMrFP2pm01TX gwkheJpDNkV8YUVzzQ4w7lrs6RMO5ksk/b/4wcbckXgfdEavs7ZX7NZSwDOKaWw4BaW5 auXhQwSzTu/9WzX9PY/nEA2GskOFj6mKKaBVIcoKjwFPSnfMk6CfvS4njVEjy8naYqFQ j3KQ== X-Gm-Message-State: AOAM530x/EpPUtUTsbAiUVKp0YCLYCXSlEnAVc/aZTQp+kwuhGwQp3SS bLh+P9fTjmd5iPSok+2vQXe3A+KQHaUu55Z9ZQ== X-Google-Smtp-Source: ABdhPJytIlPl8/QI/JQ51BlaSaCxP2yLFGD8q6lBzSY4s4mtJPCUA8BEP9n/lYGwsF553XO3CCo4yRdbQtypv0qoSYo= X-Received: by 2002:a2e:b008:: with SMTP id y8mr4646777ljk.233.1617271735288; Thu, 01 Apr 2021 03:08:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 1 Apr 2021 12:08:44 +0200 Message-ID: To: Go Kudo Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000049849b05bee66b3a" Subject: Re: [PHP-DEV] [VOTE] Object scoped RNG implementation From: guilliam.xavier@gmail.com (Guilliam Xavier) --00000000000049849b05bee66b3a Content-Type: text/plain; charset="UTF-8" On Thu, Apr 1, 2021 at 6:39 AM Go Kudo wrote: > Hello everyone. > > Object scoped RNG RFC vote is now open. > https://wiki.php.net/rfc/object_scope_prng > > The deadline for voting is April 15. > > Previous discussions can be viewed below. > > https://externals.io/message/112765 > https://externals.io/message/112819 > https://externals.io/message/113720 > > Regards, > Go Kudo > Hello, If I understand correctly, this would - provide us with performant object-encapsulated (isolated from global state) equivalents of the existing `mt_srand()`/`mt_rand()` and `random_int()` functions as well as a new "XorShift128+"; along with some global functions for usability, notably `rng_bytes()` and `rng_int()` respectively similar to `random_bytes()` and `random_int()` but with an additional (first) RNG argument - enable us to use them (the objects), as well as other (extension or userland) implementations of the `RNG\RNGInterface`, for the existing `array_rand()`, `shuffle()` and `str_shuffle()` functions (instead of the default internal MT implementation) ? I can't vote (yes), but I just suggest you complete the stubs in the RFC with what can been seen at < https://github.com/php/php-src/pull/6568/files?file-filters%5B%5D=.php#diff-d469bf38690924187e7b9db4a8ab199a99394b404bb12325a789141c56edb12f> and below, showing that the class `OS` has the minimal interface while classes `MT19937` and `XorShift128Plus` have a public `__construct(int $seed )` and implement the magic `__serialize()`/`__unserialize()`. Best regards, -- Guilliam Xavier --00000000000049849b05bee66b3a--