On Tue, May 18, 2021 at 7:19 PM Go Kudo <zeriyo...@gmail.com> wrote: > Hello internals. > > I have created a draft of the RFC. > > https://wiki.php.net/rfc/rng_extension > > This RFC is a proposal to implement the old object scope RNG in PHP. > > You can read about the discussion so far below. > > - https://externals.io/message/114378 > - https://externals.io/message/112819 > > I believe that the problem with the previous RFC was that it was just an > ugly API. I propose to sort this out and deprecate the existing functions > that should be replaced. > > I would like to ask for feedback on this draft RFC. > > Regards, > Go kudo >
This looks good. 1. instead of ext/rng and the RNG namespace, why not use ext/random and Random namespace. And incorporate also other random_* functions maybe by creating some aliases. 2. instead of Randomizer, maybe we can use just Random or RNG (if previous suggestion does not stand). 3. maybe some helper functions like Random\new_random($algo, $seed): Random\Random can be used as a factory for internal implementations. Or RNG\new_randomizer ($algo, $seed): RNG\Randomizer (if previous suggestions does not stand). 4. for public function next(): string, how many bytes should be returned? Regards, Alex