WireNumberTools::randomInteger()
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.252