15 ms·
> libc++ random is actually decent. I disagree. It does not include a contemporary RNG, and seeding the only decent one correctly is ridiculously difficult.
by whyever 7y ago
> libc++ random is actually decent.
I disagree. It does not include a contemporary RNG, and seeding the only decent one correctly is ridiculously difficult.
- earenndil 7y agoAfaik it uses mt19937? While not as good as it could be; something like pcg would probably be better, that's still very adequate. As for seeding it's pretty easy. It is stupid boilerplate that should be in the stdlib, but it's not difficult. You read from /dev/urandom if on unix, or use cryptgetrandom on windows, xor with time and pid if you really want to, and that's it.