lundi 12 juin 2017

Should I prefer ThreadLocalRandom or SecureRandom?

I know that Random class generates insecure random sequences and I should prefer using SecureRandom when dealing with security. But what about ThreadLocalRandom? Is it more or less secure?

// generate a five-digit numeric confirmation code
Long code = ThreadLocalRandom.current().nextLong(1, 99999);




Aucun commentaire:

Enregistrer un commentaire