lundi 1 août 2016

How to generate a random alphanumeric string of a custom length in java?

What is the most simple way? Minimizing any imports.

This one is good:

String str = Long.toHexString(Double.doubleToLongBits(Math.random()));

But it's not perfect, for example it complicates with custom length.




Aucun commentaire:

Enregistrer un commentaire