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

Breadcrumb

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

function RandomIdGenerator::randomHex

@psalm-suppress ArgumentTypeCoercion $hexLength is always a positive integer

2 calls to RandomIdGenerator::randomHex()
RandomIdGenerator::generateSpanId in vendor/open-telemetry/sdk/Trace/RandomIdGenerator.php
RandomIdGenerator::generateTraceId in vendor/open-telemetry/sdk/Trace/RandomIdGenerator.php

File

vendor/open-telemetry/sdk/Trace/RandomIdGenerator.php, line 36

Class

RandomIdGenerator

Namespace

OpenTelemetry\SDK\Trace

Code

private function randomHex(int $hexLength) : string {
    try {
        return bin2hex(random_bytes(intdiv($hexLength, 2)));
    } catch (Throwable) {
        return $this->fallbackAlgorithm($hexLength);
    }
}

API Navigation

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