RandomGeneratorpublic class DigestRandomGenerator extends java.lang.Object implements RandomGenerator
Internal access to the digest is synchronized so a single one of these can be shared.
| Constructor | Description |
|---|---|
DigestRandomGenerator(Digest digest) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addSeedMaterial(byte[] inSeed) |
Add more seed material to the generator.
|
void |
addSeedMaterial(long rSeed) |
Add more seed material to the generator.
|
void |
nextBytes(byte[] bytes) |
Fill bytes with random values.
|
void |
nextBytes(byte[] bytes,
int start,
int len) |
Fill part of bytes with random values.
|
public DigestRandomGenerator(Digest digest)
public void addSeedMaterial(byte[] inSeed)
RandomGeneratoraddSeedMaterial in interface RandomGeneratorinSeed - a byte array to be mixed into the generator's state.public void addSeedMaterial(long rSeed)
RandomGeneratoraddSeedMaterial in interface RandomGeneratorrSeed - a long value to be mixed into the generator's state.public void nextBytes(byte[] bytes)
RandomGeneratornextBytes in interface RandomGeneratorbytes - byte array to be filled.public void nextBytes(byte[] bytes,
int start,
int len)
RandomGeneratornextBytes in interface RandomGeneratorbytes - byte array to be filled.start - index to start filling at.len - length of segment to fill.