|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.atlassian.security.random.DefaultSecureRandomService
public final class DefaultSecureRandomService
Implementation of the SecureRandomService which delegates to a single, shared instance
of SecureRandom.
SecureRandoms block on calls to produce random data, we may improve throughput
by pooling a collection of SecureRandoms. Contention is not yet been proved to be a problem,
so it has not been implemented.
SecureRandom instance.
| Method Summary | |
|---|---|
static SecureRandomService |
getInstance()
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SecureRandomService getInstance()
DefaultSecureRandomService instance which delegates to a single, shared instance
of SecureRandom.public void nextBytes(byte[] bytes)
SecureRandomService
nextBytes in interface SecureRandomServicebytes - the array to be filled in with random bytes.SecureRandom.nextBytes(byte[])public int nextInt()
SecureRandomServiceint.
nextInt in interface SecureRandomServiceint.Random.nextInt()public int nextInt(int n)
SecureRandomServiceint value between 0 (inclusive) and
the specified value (exclusive).
nextInt in interface SecureRandomServicen - the bound on the random number to be returned. Must be
positive.
int
value between 0 (inclusive) and n (exclusive).Random.nextInt(int)public long nextLong()
SecureRandomServicelong.
nextLong in interface SecureRandomServicelong.Random.nextLong()public boolean nextBoolean()
SecureRandomServiceboolean.
nextBoolean in interface SecureRandomServiceboolean.Random.nextBoolean()public float nextFloat()
SecureRandomServicefloat.
nextFloat in interface SecureRandomServicefloat.Random.nextFloat()public double nextDouble()
SecureRandomServicedouble.
nextDouble in interface SecureRandomServicedouble.Random.nextDouble()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||