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 get_next_int to generate a random number. the rand_int 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.|
|rand_bytes||The random byte array.|
|rand_bytes_length||The length of the byte array to be generated.|
|rand_int||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.|
|get_next_bytes||Generates a sequence of random bytes.|
|get_next_int||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.
|on_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.|