sole icon indicating copy to clipboard operation
sole copied to clipboard

uuid4 seems unsafe base on C++ standards

Open DJHoltkamp opened this issue 6 years ago • 1 comments

I have found the following content on std::random_device:

std::random_device is a uniformly-distributed integer random number generator that produces non-deterministic random numbers. std::random_device may be implemented in terms of an implementation-defined pseudo-random number engine if a non-deterministic source (e.g. a hardware device) is not available to the implementation. In this case each std::random_device object may generate the same number sequence.

I am writing a cross platform game and wanting a good UUID, and the fact that these could come out as the same number on some devices (I am thinking Android in particular) is a bit terrifying. Please let me know if I am wrong and there is a better assurance that this couldn't happen.

DJHoltkamp avatar Apr 05 '18 02:04 DJHoltkamp

Looks like this could be a problem. More info: https://stackoverflow.com/questions/45069219/how-to-succinctly-portably-and-thoroughly-seed-the-mt19937-prng

dan-ryan avatar Apr 23 '18 03:04 dan-ryan