Re: Improving PRNG implementation.
| From: | Sara Golemon | Date: | Wed, 16 Dec 2020 15:56:17 +0000 |
| Subject: | Re: Improving PRNG implementation. | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112526@lists.php.net to get a copy of this message | ||
On Wed, Dec 16, 2020 at 8:46 AM zeriyoshi <zeriyoshi@gmail.com> 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