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 String |
NAME |
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.
|
String |
getName() |
int |
random(int n)
Returns a pseudo-random uniformly distributed
int
in the half-open range [0, n). |
toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindByName, getNameList, getNames, removeByNamepublic static final String NAME
public String getName()
public void fill(byte[] bytes,
int start,
int len)
Randombytes - 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 limitCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.