RandomLibAdapter
in package
implements
RandomGeneratorInterface
RandomLibAdapter provides functionality to generate strings of random binary data using the paragonie/random-lib library
Tags
Interfaces, Classes and Traits
- RandomGeneratorInterface
- RandomGeneratorInterface provides functionality to generate strings of random binary data
Table of Contents
- $generator : Generator
- __construct() : mixed
- Constructs a `RandomLibAdapter` using a `RandomLib\Generator`
- generate() : string
- Generates a string of random binary data of the specified length
Properties
$generator
private
Generator
$generator
Methods
__construct()
Constructs a `RandomLibAdapter` using a `RandomLib\Generator`
public
__construct([Generator $generator = null ]) : mixed
By default, if no Generator is passed in, this creates a high-strength
generator to use when generating random binary data.
Parameters
- $generator : Generator = null
-
An paragonie/random-lib
Generator
Return values
mixed —generate()
Generates a string of random binary data of the specified length
public
generate(int $length) : string
Parameters
- $length : int
-
The number of bytes of random binary data to generate
Return values
string —A binary string