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\NonstandardCode
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();
}