in reply to Re^4: How likely is rand() to repeat? (Mersenne)
in thread How likely is rand() to repeat?
"Just use a Mersenne Twister" doesn't solve the problem by itself.
There is no "problem" to solve.
The OP has stated that he needs less than a million IDs and is running on a 64-bit OS.
If he picks one starting point per run from the 2^64 that are possible -- using his built-in rand() or the MT19937-64 -- then he will be using 0.0000000000054210108624275221700372640043497% of the possibilities.
Another way: If he picks 1 new string, from a new starting position each time, every microsecond, he can expect a duplicate sometime in the next 50,000 years.
|
---|