Comment puis-je créer un tableau de 20 octets aléatoires en Java?
Réponses
Trop de publicités?Essayez l' Random.nextBytes
méthode:
byte[] b = new byte[20];
new Random().nextBytes(b);
Duncan
Points
22780
Le nouveau RandomUtils
classe de Apache Commons Lang en fait un one-liner:
byte[] randomBytes = RandomUtils.nextBytes(20);