There used to be a rule of thumb for Mersenne Twister that it’s good to pick a large number for rng seed. Is that still relevant for newer families like Xoshiro?
I am definitly no expert on that, but to me it looks like both Xoshiro and also MersenneTwister since 1.11 hash the seed to define the actual state of the Generator, so that advice might not apply to the high level julia interface to random streams at all?
BTW, very interesting document you linked there, had some nice information in it. However I find the main logical conclusion quite funny: So it’s super hard to write a good random number generator, so hard in fact that basically every language gets it wrong? Well then obviously it’s a good idea to write my own, which definitely won’t have any problems
Reminds me on some discussions I had with a senior researcher, who suggested I should write my own fixed step runge kutta rather than using DifferentialEquations.jl…
This depends on the application. If you need (pseudo) random numbers very fast, you should go for some fast algorithm, which might have some bad properties. If you need no-nonsense secure random numbers, you can use some cryptographic algorithm in counter mode.
I.e. you pick a seed from /dev/random
, or directly with the machine instruction rdseed
or rdrand
, which uses specialized hardware to extract entropy from thermal noise. With such a 256-bit seed as the key for your crypto-algorithm, which may e.g. be a hardware based AES available in many CPUs, you encrypt the integers 1, 2, 3, …, in succession to obtain a sequence of random numbers. If you find any problems with such a sequence it’s fine, you write it up as a publication and submit it to the IACR.