rfc:random_extension_improvement

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
rfc:random_extension_improvement [2022/07/19 17:41] – implemented zeriyoshirfc:random_extension_improvement [2022/07/22 09:55] (current) – reword two issues as the problem (VS the proposed solution) guilliamxavier
Line 36: Line 36:
 In order to preserve the implementation of the lcg_value() function, the internal implementation is retained, but the implementation as a class is being dropped to prevent users from unintentionally using it. In order to preserve the implementation of the lcg_value() function, the internal implementation is retained, but the implementation as a class is being dropped to prevent users from unintentionally using it.
  
-==== Add Randomizer::pickArrayKeys(array $array, int $num): array method ====+==== There is no equivalent of array_rand() ====
  
 <php>array_rand()</php> uses RNG internally, but there is no alternative method in ''Randomizer''. <php>array_rand()</php> uses RNG internally, but there is no alternative method in ''Randomizer''.
Line 67: Line 67:
 Therefore, it may be better to change the alternative method of str_shuffle(), ''Randomizer::shuffle**String**()'', to ''Randomizer::shuffle**Bytes**()''. This is a more appropriate name. Therefore, it may be better to change the alternative method of str_shuffle(), ''Randomizer::shuffle**String**()'', to ''Randomizer::shuffle**Bytes**()''. This is a more appropriate name.
  
-==== Refine classnames ====+==== Engine classnames are not precise ====
  
 To clearly identify the implemented algorithm, the PCG64 and MersenneTwister engines should be renamed to their canonical upstream name: To clearly identify the implemented algorithm, the PCG64 and MersenneTwister engines should be renamed to their canonical upstream name:
Line 106: Line 106:
 </doodle> </doodle>
  
-==== Add Randomizer::pickArrayKeys(array $array, int $num): array method ====+==== There is no equivalent of array_rand() ====
  
 <doodle title="Add the pickArrayKeys() method to the Randomizer?" auth="zeriyoshi" voteType="single" closed="true"> <doodle title="Add the pickArrayKeys() method to the Randomizer?" auth="zeriyoshi" voteType="single" closed="true">
Line 120: Line 120:
 </doodle> </doodle>
  
-==== Refine classnames ====+==== Engine classnames are not precise ====
  
 <doodle title="Rename PCG64 and MersenneTwister?" auth="zeriyoshi" voteType="single" closed="true"> <doodle title="Rename PCG64 and MersenneTwister?" auth="zeriyoshi" voteType="single" closed="true">
rfc/random_extension_improvement.1658252497.txt.gz · Last modified: 2022/07/19 17:41 by zeriyoshi