如何正确播种梅森倍捻机RNG? [英] How to properly seed a mersenne twister RNG?
问题描述
这其实并不是这么简单,我首先想到的。
This is actually not as simple as I first thought.
在没有硬件RNG的,什么是可以播种Mersenne扭曲的最佳方式?
In the absence of a hardware RNG, what is the best way to seed a Mersenne Twister?
或者我应该说,什么是种子是用来产生一个梅森倍捻机RNG一种可接受的方式UUID的?
Or should I say, what is an acceptable way to seed a a Mersenne Twister RNG that is used to generate UUID's?
推荐答案
有是伪随机数生成器的此处包括的PRNG的正常播种节(见第3条),它使用的md5sum
和的/ dev /随机
或的/ dev / urandom的
生成种子。
There is a nice discussion of pseudo-random number generators here including a section on the proper seeding of PRNGs (see rule 3), which uses md5sum
and /dev/random
or /dev/urandom
to generate seeds.
这还包括了一些PRNG算法的这是更容易code了大量的(小于10行code的),比MT,但可以说是一样好(很长时间并通过所有的随机性Dieharder测试)。
This also includes a number of PRNG alogrithms which are a lot easier to code up (< 10 lines of code) than the MT but are arguably just as good (long periods and pass all of the Dieharder tests for randomness).
这篇关于如何正确播种梅森倍捻机RNG?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!