Hi

On 5/31/22 11:54, Go Kudo wrote:
- More detailed description in RFC


a)

For the Random\Engine interface I suggest to clarify that the returned bytestring will be interpreted as a little endian integer.

b)

I'm still missing an explanation of the guarantees the Randomizer implementation will make (last bullet point in https://externals.io/message/117295#117299).

To me the guarantees is the most important thing about this RFC. As a user of the API I need to know what of the behavior can and what cannot change in future PHP versions. I don't really care whether the RNG is PCG64 or some Xoshiro. Both are great.

The Engine part is pretty solid: They implement a well-defined RNG and any numbers are returned as little endian integers (see (a)). Either the implementation is correct or it is not. This is not likely to change in the future.

However the Randomizer part is pretty undefined: As an example: ->getInt() will return an integer uniformly selected from the given range. But there's more than one way to perform this uniform selection. Will the algorithm stay the safe in future PHP versions? There are more examples in my previous emails.

Best regards
Tim Düsterhus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to