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

Breadcrumb

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

function UuidV6::toUuidV1

Converts this UUID into an instance of a version 1 UUID

File

vendor/ramsey/uuid/src/Nonstandard/UuidV6.php, line 73

Class

UuidV6
Reordered time, or version 6, UUIDs include timestamp, clock sequence, and node values that are combined into a 128-bit unsigned integer

Namespace

Ramsey\Uuid\Nonstandard

Code

public function toUuidV1() : UuidV1 {
    $hex = $this->getHex()
        ->toString();
    $hex = substr($hex, 7, 5) . substr($hex, 13, 3) . substr($hex, 3, 4) . '1' . substr($hex, 0, 3) . substr($hex, 16);
    
    /** @var LazyUuidFromString $uuid */
    $uuid = Uuid::fromBytes((string) hex2bin($hex));
    return $uuid->toUuidV1();
}

API Navigation

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