SecureRandom which relies on ThreadLocalRandom#current() for random number
generation.
| Modifier and Type | Field and Description |
|---|---|
| private static final SecureRandom | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static SecureRandom | |
| public byte[] | generateSeed(int
the number of seed bytes to generate. numBytes)Overrides java. |
| public String | getAlgorithm()
Overrides java. SecureRandom object.
|
| public boolean | nextBoolean()
Overrides java. Overrides default java. boolean value from this random number generator's
sequence.
|
| public void | nextBytes(byte[]
the array to be filled in with random bytes. bytes)Overrides java. Overrides default java. |
| public double | nextDouble()
Overrides java. Overrides default java. double value between 0.0 and
1.0 from this random number generator's sequence.
|
| public float | nextFloat()
Overrides java. Overrides default java. float
value between 0.0 and 1.0 from this random
number generator's sequence.
|
| public double | nextGaussian()
Overrides java. Overrides default java. double value with mean 0.0 and standard
deviation 1.0 from this random number generator's sequence.
|
| public int | nextInt()
Overrides java. Overrides default java. int
value from this random number generator's sequence.
|
| public int | nextInt(int
the upper bound (exclusive). Must be positive. n)Overrides java. Overrides default java. int value
between 0 (inclusive) and the specified value (exclusive), drawn from
this random number generator's sequence.
|
| public long | nextLong()
Overrides java. Implements java. long
value from this random number generator's sequence.
|
| private static Random | |
| public void | setSeed(byte[]
the seed. seed)Overrides java. |
| public void | setSeed(long
the seed. seed)Overrides java. long seed.
|
| INSTANCE | back to summary |
|---|---|
| private static final SecureRandom INSTANCE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ThreadLocalInsecureRandom | back to summary |
|---|---|
| private ThreadLocalInsecureRandom() | |
| current | back to summary |
|---|---|
| pack-priv static SecureRandom current() | |
| generateSeed | back to summary |
|---|---|
| public byte[] generateSeed(int numBytes) Overrides java. Doc from java. Returns the given number of seed bytes, computed using the seed generation algorithm that this class uses to seed itself. This call may be used to seed other random number generators.
| |
| getAlgorithm | back to summary |
|---|---|
| public String getAlgorithm() Overrides java. Doc from java. Returns the name of the algorithm implemented by this
| |
| nextBoolean | back to summary |
|---|---|
| public boolean nextBoolean() Overrides java. Overrides default java. Doc from java. Returns the next pseudorandom, uniformly distributed
| |
| nextBytes | back to summary |
|---|---|
| public void nextBytes(byte[] bytes) Overrides java. Overrides default java. Doc from java. Generates a user-specified number of random bytes.
| |
| nextDouble | back to summary |
|---|---|
| public double nextDouble() Overrides java. Overrides default java. Doc from java. Returns the next pseudorandom, uniformly distributed
The general contract of
| |
| nextFloat | back to summary |
|---|---|
| public float nextFloat() Overrides java. Overrides default java. Doc from java. Returns the next pseudorandom, uniformly distributed The general contract of
| |
| nextGaussian | back to summary |
|---|---|
| public double nextGaussian() Overrides java. Overrides default java. Doc from java. Returns the next pseudorandom, Gaussian ("normally") distributed
The general contract of
| |
| nextInt | back to summary |
|---|---|
| public int nextInt() Overrides java. Overrides default java. Doc from java. Returns the next pseudorandom, uniformly distributed
| |
| nextInt | back to summary |
|---|---|
| public int nextInt(int n) Overrides java. Overrides default java. Doc from java. Returns a pseudorandom, uniformly distributed
| |
| nextLong | back to summary |
|---|---|
| public long nextLong() Overrides java. Implements java. Doc from java. Returns the next pseudorandom, uniformly distributed
| |
| random | back to summary |
|---|---|
| private static Random random() | |
| setSeed | back to summary |
|---|---|
| public void setSeed(byte[] seed) Overrides java. Doc from java. Reseeds this random object with the given seed. The seed supplements, rather than replaces, the existing seed. Thus, repeated calls are guaranteed never to reduce randomness.
A PRNG
| |
| setSeed | back to summary |
|---|---|
| public void setSeed(long seed) Overrides java. Doc from java. Reseeds this random object, using the eight bytes contained
in the given
A PRNG This method is defined for compatibility with
| |