Skip to content

RandomLibAdapter

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

See Also:

  • https://packagist.org/packages/paragonie/random-lib - paragonie/random-lib

Properties

generator

private \RandomLib\Generator $generator

Methods

__construct

Constructs a RandomLibAdapter

public __construct(\RandomLib\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:

Parameter Type Description
$generator \RandomLib\Generator|null The generator to use when generating binary data

generate

Generates a string of randomized binary data

public generate(int $length): string

Parameters:

Parameter Type Description
$length int The number of bytes of random binary data to generate

Return Value:

A binary string



Automatically generated on 2025-03-18