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

Breadcrumb

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

function GenericNumberConverter::toHex

@inheritDoc @psalm-pure @psalm-return non-empty-string @psalm-suppress MoreSpecificReturnType we know that the retrieved `string` is never empty @psalm-suppress LessSpecificReturnStatement we know that the retrieved `string` is never empty

Overrides NumberConverterInterface::toHex

File

vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php, line 52

Class

GenericNumberConverter
GenericNumberConverter uses the provided calculator to convert decimal numbers to and from hexadecimal values

Namespace

Ramsey\Uuid\Converter\Number

Code

public function toHex(string $number) : string {
    
    /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */
    return $this->calculator
        ->toBase(new IntegerObject($number), 16);
}

API Navigation

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