How do the "random" generators in different languages (i.e. Java and C++) compare? -


despite weird title, wish ask legitimate question: method's generated numbers more random: java's random() class or math.random(), or c++'s rand()?

i've heard php's rand() quite bad, i.e. if map results can see pattern; sadly, don't know how draw map in c++ or java.

also, out of interest, c#?

both java , c++ generate pseudo-random numbers either:

  • adequate task isn't statistician or cryptographer (a); or
  • woefully inadequate 2 classes of people.

in honesty, unless are in 1 of classes, pseudo-random number generators fine.

java has securerandom purports provide crypto-class non-determinism (i can't comment on veracity of argument) , c++ has wider variety of random number generation capability rand() - see <random> details.

specific operating systems may provides sources of entropy random number generators such cryptgenrandom under windows or reading /dev/random under linux. alternatively, add entropy using random events such user input timing.


(a) may contain traces of other job types aren't statistician or cryptographer :-)


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -