4 ms·
How robust is C#'s pseudo-random number generator?
Anyone have a reference for a robust analysis of C#'s uniform pseudo-random number generator? I am writing something that uses the Random class and want to make sure it satisfies marsaglia / bruce schmeiser's criteria for RNGs. I don't even know if it uses mersenne twister, for example; I was hoping since C# is popular enough I might save some time using the legwork of others. If nothing is out there, I might put together an analysis myself.
Any help is appreciated.
Thanks,
Myles
- stonemetal 13y agoThe standard one in System.Random uses Donald E. Knuth's subtractive random number generator algorithm according to the documentation. Which shouldn't be too hard to find an anlysis on. http://msdn.microsoft.com/en-us/library/system.random(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/system.random(v=vs.1... Then there is the Cryptographically secure one over in System.Security.Cryptography.RandomNumberGenerator I believe it uses CryptGenRandom under the hood, so I believe it has been analysed.
- mydpy 13y agoThank you so much, that's enough for me to sink my teeth into for now. I appreciate the feedback.