Documentation

RandomLibAdapter
in package
implements RandomGeneratorInterface

RandomLibAdapter generates strings of random binary data using the paragonie/random-lib library

Tags
deprecated

This class will be removed in 5.0.0. Use the default RandomBytesGenerator or implement your own generator that implements RandomGeneratorInterface.

link

paragonie/random-lib

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

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

Search results