IPWorks Encrypt 2020 PHP Edition

Questions / Feedback?

EzRand Class

Properties   Methods   Events   Configuration Settings   Errors  

The EzRand class can be used to generate random numbers or bytes using a variety of algorithms.

Class Name

IPWorksEncrypt_EzRand

Procedural Interface

 ipworksencrypt_ezrand_open();
 ipworksencrypt_ezrand_close($res);
 ipworksencrypt_ezrand_register_callback($res, $id, $function);
 ipworksencrypt_ezrand_get_last_error($res);
 ipworksencrypt_ezrand_get_last_error_code($res);
 ipworksencrypt_ezrand_set($res, $id, $index, $value);
 ipworksencrypt_ezrand_get($res, $id, $index);
 ipworksencrypt_ezrand_do_config($res, $configurationstring);
 ipworksencrypt_ezrand_do_getnextbytes($res);
 ipworksencrypt_ezrand_do_getnextint($res);
 ipworksencrypt_ezrand_do_reset($res);

Remarks

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.

To generate a random set of bytes set RandBytesLength to the desired number of bytes and call GetNextBytes.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

AlgorithmThe random number algorithm.
MaxThe exclusive upper bound.
MinThe inclusive lower bound.
RandBytesThe random byte array.
RandBytesLengthThe length of the byte array to be generated.
RandIntThe random integer.
SeedThe seed.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

ConfigSets or retrieves a configuration setting.
GetNextBytesGenerates a sequence of random bytes.
GetNextIntGenerates a random integer.
ResetResets the class.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

ErrorInformation about errors during data delivery.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

OutputEncodingThe encoding applied to the generated bytes.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Encrypt 2020 PHP Edition - Version 20.0 [Build 8155]