function RandomLibAdapter::__construct
Constructs a RandomLibAdapter
By default, if no Generator is passed in, this creates a high-strength generator to use when generating random binary data.
Parameters
Generator|null $generator The generator to use when generating binary data:
File
-
vendor/
ramsey/ uuid/ src/ Generator/ RandomLibAdapter.php, line 42
Class
- RandomLibAdapter
- RandomLibAdapter generates strings of random binary data using the paragonie/random-lib library
Namespace
Ramsey\Uuid\GeneratorCode
public function __construct(?Generator $generator = null) {
if ($generator === null) {
$factory = new Factory();
$generator = $factory->getHighStrengthGenerator();
}
$this->generator = $generator;
}