Java API Tutorial - Java SecureRandom.getSeed(int numBytes)








Syntax

SecureRandom.getSeed(int numBytes) has the following syntax.

public static byte[] getSeed(int numBytes)

Example

In the following code shows how to use SecureRandom.getSeed(int numBytes) method.

/*www .  j  a  v  a2  s. c  o m*/
import java.security.SecureRandom;
import java.util.Arrays;

public class Main {
  public static void main(String[] argv) throws Exception {

    System.out.println(Arrays.toString(SecureRandom.getSeed(8)));
  }
}

The code above generates the following result.