lundi 11 décembre 2017

After how many values does rand() repeat a duplex pattern?

RAND_MAX on my system is 32767.

I need to generate millions of passwords. I plan to do it as follows:

printf("%d%d",rand()+1,rand()+1);

Is this a good way to do it? After how many iterations would I find a repetition? Since these are passwords, even a single repetition cannot be accepted.




Aucun commentaire:

Enregistrer un commentaire