jeudi 30 décembre 2021

Generate truly random numbers with C++ (Windows 10 x64)

I am trying to create a password generator. I used the random library, and after reading the documentation, I found out that rand() depends on an algorithm and a seed (srand()) to generate the random number. I tried using the current time as a seed (srand(time(0))), but that is not truly random. Is there a way to generate truly random numbers? Or maybe get the current time very accurately (like, in microseconds)? My platform is Windows 10 x64.




Aucun commentaire:

Enregistrer un commentaire