C# Class RandomOps.RandomDotOrg

Random Number Generator (RNG) that downloads random bytes from the internet website: www.random.org. Not thread-safe. These random bytes are generated from atmospheric noise picked up by radios. Only a certain number of bits are allowed to be downloaded from this website to your IP address each day, so this RNG is used with a Fallback-PRNG.
Inheritance: ByteStream
Afficher le fichier Open project: DanWBR/dwsim3 Class Usage Examples

Méthodes publiques

Méthode Description
RandomDotOrg ( int bufferSize, Random randFallback, int numFallback ) : System.Collections.Generic

Constructs the RNG-object.

RetrieveBytes ( int length ) : List

Do the actual retrieval of random bytes from the www.random.org website.

Méthodes protégées

Méthode Description
DoFillBuffer ( int length ) : void

Called from ByteStream to request the retrieval of random bytes.

Method Details

DoFillBuffer() protected final méthode

Called from ByteStream to request the retrieval of random bytes.
protected final DoFillBuffer ( int length ) : void
length int The number of bytes requested.
Résultat void

RandomDotOrg() public méthode

Constructs the RNG-object.
public RandomDotOrg ( int bufferSize, Random randFallback, int numFallback ) : System.Collections.Generic
bufferSize int Number of random bytes the buffer holds.
randFallback Random Fallback RNG to be used when buffer is empty.
numFallback int Use fallback RNG for this many bytes before trying to fill buffer again.
Résultat System.Collections.Generic

RetrieveBytes() public static méthode

Do the actual retrieval of random bytes from the www.random.org website.
/// Thrown if daily download quota is depleted, /// the HTTP response code is 503 for 'Server Unavailable'. ///
public static RetrieveBytes ( int length ) : List
length int Number of bytes to retrieve (max 10000).
Résultat List