generateSeed() on the SecureRandom
instance.public class MetaSeedGenerator extends SeedGenerator
To use it, first set the initial seed via one of the static setSeed() methods. Then create as many instances as you like using the constructors. It is anticipated that this seed generator will often be used as the default seed generator following an initialisation from user input.
NOTE: For obvious reasons, the initial seed should be as least as long as the longest seed that later is to be deducted from it. Also, as this classes uses the system's default PRNG (usually SHA1Random), so it can never generate true random seeds longer than the PRNG digest (160 bits for SHA1Random).
SeedGenerator,
SHA1RandomseedGenListener| Constructor and Description |
|---|
MetaSeedGenerator()
Deprecated.
Initialize generation of a seed with the default amount of
randomness (160 bit).
|
MetaSeedGenerator(int numBits)
Deprecated.
Initialize generation of a seed with the specified amount of
randomness.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getSeed()
Deprecated.
Get the seed.
|
int[] |
getStatus()
Deprecated.
Return the status of seed generation.
|
static void |
setSeed(byte[] seed)
Deprecated.
Set the initial seed to this byte array.
|
callSeedGenListener, getDefault, getDefaultSeedGenerator, longToBytes, seedAvailable, setDefault, setDefaultSeedGenerator, setSeedGenListenerpublic MetaSeedGenerator()
public MetaSeedGenerator(int numBits)
throws RandomException
setSeed().
See the notes at the top of this class
about the value of this number.RandomExceptionpublic static void setSeed(byte[] seed)
public int[] getStatus()
{numBits, numBits}, i.e. it is always ok to call getSeed().getStatus in class SeedGeneratorpublic byte[] getSeed()
getSeed in class SeedGenerator