class RandomLibAdapter implements RandomGeneratorInterface (View source)

RandomLibAdapter provides functionality to generate strings of random binary data using the ircmaxell/random-lib library

Methods

__construct(Generator $generator = null)

Constructs a RandomLibAdapter using a RandomLib\Generator

string
generate(integer $length)

Generates a string of random binary data of the specified length

Details

__construct(Generator $generator = null)

Constructs a RandomLibAdapter using a RandomLib\Generator

By default, if no Generator is passed in, this creates a medium-strength generator to use when generating random binary data.

Parameters

Generator $generator An ircmaxell/random-lib Generator

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