public final class BouncyCastleRandom extends AbstractRandom
Random
. This pseudo random number generator uses the a very fast PRNG from BouncyCastle.
The JRE random will be used when creating a new generator to add some random data to the seed.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
private org.bouncycastle.crypto.prng.RandomGenerator |
random |
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Constructor and Description |
---|
BouncyCastleRandom() |
Modifier and Type | Method and Description |
---|---|
void |
fill(byte[] bytes,
int start,
int len)
Fill part of bytes with random values.
|
java.lang.String |
getName() |
private int |
next(int numBits) |
int |
random(int n)
Returns a pseudo-random uniformly distributed
int in the half-open range [0, n). |
toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findByName, getNameList, getNames, ofName, removeByName
public static final java.lang.String NAME
private final org.bouncycastle.crypto.prng.RandomGenerator random
public java.lang.String getName()
public void fill(byte[] bytes, int start, int len)
Random
bytes
- byte array to be filled.start
- index to start filling at.len
- length of segment to fill.public int random(int n)
int
in the half-open range [0, n).n
- The range upper limitprivate int next(int numBits)