is everything written in C?

Pages: 12
Unless GCC changed things recently there is at least one particular, documented area where VS is clearly out ahead.

std::random_device.

GCC returns an entropy estimate of zero, indicating they are using a pseudo-random number engine instead of having a true random number generator.


GCC has returned the entropy on Linux correctly since around GCC 8.1. MSVC just always returns 32: https://github.com/microsoft/STL/blob/master/stl/inc/random#L4966

MinGW for a fair while didn't have a "true" implementation of `random_device' on Windows; this was fixed for GCC 9.2: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85494
Nice to know my info about std::random_device was outdated. :)

Not that in the end it really matters, I prefer using one of the PRNGs in <random> instead.

Those will work no matter what the compiler or version.
std::random_random device is a poorly-designed piece of hud. I won't use it.

Which is why I wrote CSPRNG, which you can find on my github.
I will stick with what the <random> library has to offer, my needs are such that I don't require NSA level crypto randomness.
Last edited on
Topic archived. No new replies allowed.
Pages: 12