Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RandomLibAdapter.php

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\Generator

Code

public function __construct(?Generator $generator = null) {
    if ($generator === null) {
        $factory = new Factory();
        $generator = $factory->getHighStrengthGenerator();
    }
    $this->generator = $generator;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal