RandomLibAdapter
in package
implements
RandomGeneratorInterface
RandomLibAdapter generates strings of random binary data using the paragonie/random-lib library
Tags
Interfaces, Classes, Traits and Enums
- RandomGeneratorInterface
- A random generator generates strings of random binary data
Table of Contents
- $generator : Generator
- __construct() : mixed
- Constructs a RandomLibAdapter
- generate() : string
- Generates a string of randomized binary data
Properties
$generator
private
Generator
$generator
Methods
__construct()
Constructs a RandomLibAdapter
public
__construct([Generator|null $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 = null
-
The generator to use when generating binary data
Return values
mixed —generate()
Generates a string of randomized binary data
public
generate(int $length) : string
Parameters
- $length : int
-
The number of bytes of random binary data to generate
Return values
string —A binary string