Randval

Implements \Joomla\CMS\Encrypt\RandValInterface

Generates cryptographically-secure random values.

since

4.0.0

Methods

generate

Returns a cryptographically secure random value.

generate(integer $bytes = 32) : string

This method allows us to quickly address any future issues if we ever find problems with PHP's random_bytes() on some weird host (you can't be too careful when releasing mass-distributed software).

Arguments

$bytes

integerHow many bytes to return

Response

string