2022年6月18日(土) 2:14 Tim Düsterhus <t...@bastelstu.be>: > Hi > > On 6/17/22 19:04, Go Kudo wrote: > > RFC has been updated. Includes corrections to areas pointed out by Tim > and > > changes MersenneTwister to MT19937. > > I also made it possible to vote for each item. > > I suggest to split the "PCG is not so famous" vote into 2 votes to make > it clear how exactly the majority is calculated and to have a clear > primary vote as indicated in > > https://wiki.php.net/rfc/voting#required_majority > > > https://wiki.php.net/rfc/random_extension_improvement > > > > How about it? > > > > for Tim: > > > >> I believe you missed my suggestion (4) > > > > My apologies! I had completely missed that. > > That new feature sounds good to me. But, I think the method name > > `pickString()` would be better. (It is interoperable with > `pickArrayKey()`) > > I don't think that ->pickString() is a good name, because it is not > really comparable to pickArrayKey(): pickArrayKey() will return each key > only once. It is more comparable to: > > substr($r->shuffleString('0123456789abcdef'), 0, 6) > > My proposed ->randomString() must be able to return a character multiple > times. > > If you don't like ->randomString(), I have an alternative suggestion: > ->stringFromCharset() > > Best regards > Tim Düsterhus >
> "PCG is not so famous" vote into 2 votes My apologies. This is a complete mistake. Since PCG64 has already clarified its implementation in an earlier RFC, removing it does not seem to be an option. The item has been removed. > I don't think that ->pickString() is a good name I see. But I think `randomString()` is ambiguous with `getBytes()`. `stringFromCharset(string $string, int $num): string` solves that, but I think it is possible that the meaning of "char" is not well known in the PHP world (although I think this name is most appropriate) How about adding an optional `?int $num` argument to `shuffleString(string $string, ?int $num): string`? Regards Go Kudo