vendredi 17 janvier 2020

Why is the reentrant random generator rand_r() considered weak?

The man page for rand_r() states:

The value pointed to by the seedp argument of rand_r() provides only a very small amount of state, so this function will be a weak pseudo-random generator.

Could someone explain what this sentence means? How is it that the seed value "provides only a very small amount of state", and how does that weaken the generator?

Before I start using the GNU extension drand48_r() as a better alternative, I want to be sure I am making an informed choice. Perhaps for some use cases rand_r() is sufficient, otherwise there would be no sense in it being available.




Aucun commentaire:

Enregistrer un commentaire