public interface SecureRandomService
SecureRandom.
Using this interface instead of using SecureRandom directly will
allow implementations to provide security or performance improvements (such as dynamic
re-seeding) without any changes to client code.
Implementations are required to be thread-safe.
| Modifier and Type | Method and Description |
|---|---|
boolean |
nextBoolean()
Returns the next pseudorandom
boolean. |
void |
nextBytes(byte[] bytes)
Generates a user-specified number of random bytes.
|
double |
nextDouble()
Returns the next pseudorandom
double. |
float |
nextFloat()
Returns the next pseudorandom
float. |
int |
nextInt()
Returns the next pseudorandom
int. |
int |
nextInt(int n)
Returns a pseudorandom,
int value between 0 (inclusive) and
the specified value (exclusive). |
long |
nextLong()
Returns the next pseudorandom
long. |
void nextBytes(byte[] bytes)
bytes - the array to be filled in with random bytes.SecureRandom.nextBytes(byte[])int nextInt()
int.int.Random.nextInt()int nextInt(int n)
int value between 0 (inclusive) and
the specified value (exclusive).n - the bound on the random number to be returned. Must be
positive.int
value between 0 (inclusive) and n (exclusive).IllegalArgumentException - if n is not positiveRandom.nextInt(int)long nextLong()
long.long.Random.nextLong()boolean nextBoolean()
boolean.boolean.Random.nextBoolean()float nextFloat()
float.float.Random.nextFloat()double nextDouble()
double.double.Random.nextDouble()Copyright © 2017 Atlassian. All rights reserved.