reproducible random number series

后端 未结 3 2015
心在旅途
心在旅途 2021-02-20 10:10

How can i get a series of reproducible pseudorandom numbers in PHP?

In older versions of PHP i could do that just by using the same seed in the RNG, but it does not work

3条回答
  •  我寻月下人不归
    2021-02-20 10:54

    The Mersenne Twist is a nice fast PRNG and here's a public domain PHP implementation for it:

    http://kingfisher.nfshost.com/sw/twister/

    That only works on PHP 5.3.0 and above.

提交回复
热议问题