Uncommons Maths API
(Version 1.2.3)

org.uncommons.maths.random
Class DevRandomSeedGenerator

java.lang.Object
  extended by org.uncommons.maths.random.DevRandomSeedGenerator
All Implemented Interfaces:
SeedGenerator

public class DevRandomSeedGenerator
extends Object
implements 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.

Author:
Daniel Dyer

Constructor Summary
DevRandomSeedGenerator()
           
 
Method Summary
 byte[] generateSeed(int length)
          Generate a seed value for a random number generator.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DevRandomSeedGenerator

public DevRandomSeedGenerator()
Method Detail

generateSeed

public byte[] generateSeed(int length)
                    throws SeedException
Generate a seed value for a random number generator.

Specified by:
generateSeed in interface SeedGenerator
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

public String toString()
Overrides:
toString in class Object

Uncommons Maths API
(Version 1.2.3)