The EzRand class can be used to generate random numbers or bytes using a variety of algorithms.
The EzRand class can be used to generate random numbers or bytes using a variety of algorithms and implementations.
To begin first set the Algorithm property to the desired value. This property specifies the algorithm and implementation that will be used to generate the number or bytes. Possible choices include ISAAC, the Microsoft Crypto API, and platform specific random and secure random implementations.
Next set Min and Max to define the acceptable range of values when generating an integer. The Seed property may optionally be set. Then simply call GetNextInt to generate a random number. the RandInt property will be populated with the generated value.
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
|Algorithm||The random number algorithm.|
|Max||The exclusive upper bound.|
|Min||The inclusive lower bound.|
|RandBytes||The random byte array.|
|RandBytesLength||The length of the byte array to be generated.|
|RandInt||The random integer.|
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
|Config||Sets or retrieves a configuration setting.|
|GetNextBytes||Generates a sequence of random bytes.|
|GetNextInt||Generates a random integer.|
|Reset||Resets the class.|
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
|Error||Information about errors during data delivery.|
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
|OutputEncoding||The encoding applied to the generated bytes.|
|BuildInfo||Information about the product's build.|
|CodePage||The system code page used for Unicode to Multibyte translations.|
|LicenseInfo||Information about the current license.|
|ProcessIdleEvents||Whether the class uses its internal event loop to process events when the main thread is idle.|
|SelectWaitMillis||The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.|
|UseInternalSecurityAPI||Tells the class whether or not to use the system security libraries or an internal implementation.|