Package org.uncommons.maths.random
Class DevRandomSeedGenerator
java.lang.Object
org.uncommons.maths.random.DevRandomSeedGenerator
- All Implemented Interfaces:
SeedGenerator
RNG seed strategy that gets data from /dev/random on systems
that provide it (e.g. Solaris/Linux). If /dev/random does not
exist or is not accessible, a
SeedException
is thrown.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
generateSeed
(int length) Generate a seed value for a random number generator.toString()
-
Field Details
-
DEV_RANDOM
-
-
Constructor Details
-
DevRandomSeedGenerator
public DevRandomSeedGenerator()
-
-
Method Details
-
generateSeed
Generate a seed value for a random number generator.- Specified by:
generateSeed
in interfaceSeedGenerator
- Parameters:
length
- The length of the seed to generate (in bytes).- Returns:
- The requested number of random bytes, read directly from /dev/random.
- Throws:
SeedException
- If /dev/random does not exist or is not accessible
-
toString
-