Documentation

RandomBytesGenerator
in package
implements RandomGeneratorInterface

RandomBytesGenerator provides functionality to generate strings of random binary data using `random_bytes()` function in PHP 7+ or paragonie/random_compat

Tags
link
http://php.net/random_bytes
link
https://github.com/paragonie/random_compat

Interfaces, Classes and Traits

RandomGeneratorInterface
RandomGeneratorInterface provides functionality to generate strings of random binary data

Table of Contents

generate()  : string
Generates a string of random binary data of the specified length

Methods

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

Tags
throws
Exception

if it was not possible to gather sufficient entropy

Return values
string

A binary string

Search results