Documentation

SodiumRandomGenerator
in package
implements RandomGeneratorInterface

SodiumRandomGenerator provides functionality to generate strings of random binary data using the PECL libsodium extension

Tags
deprecated

As of PHP 7.2.0, the libsodium extension is bundled with PHP, and the random_bytes() PHP function is now the recommended method for generating random byes. The default RandomBytesGenerator uses the random_bytes() function. This generator will be removed in ramsey/uuid 4.0.0.

link
http://pecl.php.net/package/libsodium
link
https://paragonie.com/book/pecl-libsodium

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