Return a random integer (cryptographically secure when available)
Available since version 3.0.214.
Usage
// basic usage
$int = $wireNumberTools->randomInteger(int $min, int $max);
// usage with all arguments
$int = $wireNumberTools->randomInteger(int $min, int $max, bool $throw = false);
Arguments
Name | Type(s) | Description |
---|---|---|
min | int | Minimum value (default=0) |
max | int | Maximum value (default=PHP_INT_MAX) |
throw (optional) | bool | Throw WireException if we cannot achieve a cryptographically secure random number? (default=false) |
Return value
int
WireNumberTools methods and properties
API reference based on ProcessWire core version 3.0.236