Interface ByteArrayReseedableRandom
-
- All Known Implementing Classes:
AesCounterRandom
,BaseRandom
,BaseSplittableRandomAdapter
,CipherCounterRandom
,Cmwc4096Random
,DirectSplittableRandomAdapter
,EntropyBlockingRandomWrapper
,EntropyBlockingSplittableRandomAdapter
,MersenneTwisterRandom
,Pcg128Random
,Pcg64Random
,RandomWrapper
,ReseedingThreadLocalRandomWrapper
,SingleThreadSplittableRandomAdapter
,SplittableRandomAdapter
,ThreadLocalRandomWrapper
,XorShiftRandom
public interface ByteArrayReseedableRandom
ARandom
that can be reseeded using a byte array instead of usingRandom.setSeed(long)
(although that may also be supported).- Author:
- Chris Hennick
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getNewSeedLength()
Returns the preferred length of a new byte-array seed.boolean
preferSeedWithLong()
Indicates whetherRandom.setSeed(long)
is recommended oversetSeed(byte[])
when the seed is already in the form of along
.void
setSeed(byte[] seed)
Reseed this PRNG.
-
-
-
Method Detail
-
setSeed
void setSeed(byte[] seed)
Reseed this PRNG.- Parameters:
seed
- The PRNG's new seed.
-
getNewSeedLength
int getNewSeedLength()
Returns the preferred length of a new byte-array seed. "Preferred" is implementation-defined when multiple seed lengths are supported, but should probably usually mean the longest one, since the longer the seed, the more random the output.- Returns:
- The desired length of a new byte-array seed.
-
preferSeedWithLong
boolean preferSeedWithLong()
Indicates whetherRandom.setSeed(long)
is recommended oversetSeed(byte[])
when the seed is already in the form of along
.- Returns:
- true if
Random.setSeed(long)
will tend to perform better thansetSeed(byte[])
.
-
-