3 ms·
Some rand() implementation are really really bad for pretty much anything. Obviously, it is not cryptographically secure but these RNGs are a class of their ow
by GuB-42 9y ago
Some rand() implementation are really really bad for pretty much anything.
Obviously, it is not cryptographically secure but these RNGs are a class of their own and are typically much slower than needed for other applications.
The problem with rand() is that it may be unseeded (same result each time you run the program), have a very short period, very short range, and fail even basic randomness tests. Fill an image with rand() results and it may not look random at all.
It may not be good enough for monte-carlo simulations, fuzz testing, probabilistic algorithms and structures, etc... Some rand() implementations are too poor even for casual games.
A good example of a terrible RNG causing trouble is in the Monster Hunter 3 Ultimate game. There are some randomly generated items in it that cannot be accessed because of the RNG. Players call it "charm tables" but it is just a result of a really poor RNG.