Here you can find the source of randomBytes(final int numBytes)
Parameter | Description |
---|---|
numBytes | The size of the array |
public static byte[] randomBytes(final int numBytes)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { public static final Random SEEDED_RANDOM = new Random(192348092834L); /**/* w w w . j a v a 2s . c o m*/ * Generate an array of random bytes * * @param numBytes The size of the array */ public static byte[] randomBytes(final int numBytes) { byte[] bytes = new byte[numBytes]; SEEDED_RANDOM.nextBytes(bytes); return bytes; } }