class RandomBytesGenerator implements RandomGeneratorInterface (View source)

RandomBytesGenerator provides functionality to generate strings of random binary data using random_bytes() function in PHP 7+ or paragonie/random_compat

Methods

string
generate(integer $length)

Generates a string of random binary data of the specified length

Details

string generate(integer $length)

Generates a string of random binary data of the specified length

Parameters

integer $length The number of bytes of random binary data to generate

Return Value

string A binary string