Documentation

OpenSslGenerator
in package
implements RandomGeneratorInterface

OpenSslRandomGenerator provides functionality to generate strings of random binary data using the `openssl_random_pseudo_bytes()` PHP function

The use of this generator requires PHP to be compiled using the --with-openssl option.

Tags
deprecated

The openssl_random_pseudo_bytes() function is not a reliable source of randomness. The default RandomBytesGenerator, which uses the random_bytes() function, is recommended as the safest and most reliable source of randomness. This generator will be removed in ramsey/uuid 4.0.0.

link
http://php.net/openssl_random_pseudo_bytes

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

Return values
string

A binary string

Search results