Package org.uncommons.maths.random
Class RandomDotOrgSeedGenerator
java.lang.Object
org.uncommons.maths.random.RandomDotOrgSeedGenerator
- All Implemented Interfaces:
SeedGenerator
Connects to the random.org
website (via HTTPS) and downloads a set of random bits to use as seed data. It
is generally better to use the
DevRandomSeedGenerator
where possible,
as it should be much quicker. This seed generator is most useful on Microsoft
Windows and other platforms that do not provide /dev/random.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
generateSeed
(int length) Generate a seed value for a random number generator.toString()
-
Constructor Details
-
RandomDotOrgSeedGenerator
public RandomDotOrgSeedGenerator()
-
-
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:
- A byte array containing the seed data.
- Throws:
SeedException
- If a seed cannot be generated for any reason.
-
toString
-