|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xlattice.crypto.CryptoRNG
public class CryptoRNG
Random number generator with crypto-level security. Wherever a value is described as "random" in the comments on methods, it should be understood that the value is a pseudo- random value and that the set of such values is very nearly uniformly distributed over the interval in question, except that Gaussian values have a distribution which is very nearly Gaussian. This should be one of two classes implementing an RNG interface, with the other class offering a lower-quality (and therefore cheaper) pseudo-random number sequence. XXX This implementation is the thinnest of wrappers around the XXX JCA SecureRandom class.
| Constructor Summary | |
|---|---|
CryptoRNG()
|
|
CryptoRNG(byte[] seed)
|
|
| Method Summary | |
|---|---|
boolean |
nextBoolean()
|
void |
nextBytes(byte[] b)
Fills the byte array with random bytes. |
double |
nextDouble()
|
float |
nextFloat()
|
double |
nextGaussian()
Returns a random value from a Gaussian sequence with mean 0.0 and standard deviation 1.0. |
int |
nextInt()
|
int |
nextInt(int n)
Returns a pseudo-random value between 0 (inclusive) and n (exclusive). |
long |
nextLong()
|
void |
reseed(byte[] seed)
Reseed the random number generator using the binary value passed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CryptoRNG()
public CryptoRNG(byte[] seed)
| Method Detail |
|---|
public boolean nextBoolean()
public void nextBytes(byte[] b)
public double nextDouble()
public float nextFloat()
public double nextGaussian()
public int nextInt()
public int nextInt(int n)
public long nextLong()
public void reseed(byte[] seed)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||