Documentation

RandomBytesGenerator
in package
implements RandomGeneratorInterface

RandomBytesGenerator generates strings of random binary data using the built-in `random_bytes()` PHP function

Tags
link

random_bytes()

Interfaces, Classes, Traits and Enums

RandomGeneratorInterface
A random generator generates strings of random binary data

Table of Contents

generate()  : string
Generates a string of randomized binary data

Methods

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

Tags
throws
RandomSourceException

if random_bytes() throws an exception/error

inheritDoc
Return values
string

A binary string

Search results