class OpenSslGenerator implements RandomGeneratorInterface (View source)

OpenSslRandomGenerator provides functionality to generate strings of random binary data using the openssl_random_pseudo_bytes() PHP function

The use of this generator requires PHP to be compiled using the --with-openssl option.

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