function LazyUuidFromString::fromBytes
@psalm-pure
1 call to LazyUuidFromString::fromBytes()
- UuidFactory::uuidFromBytesAndVersion in vendor/
ramsey/ uuid/ src/ UuidFactory.php - Returns an RFC 4122 variant Uuid, created from the provided bytes and version
File
-
vendor/
ramsey/ uuid/ src/ Lazy/ LazyUuidFromString.php, line 69
Class
- LazyUuidFromString
- Lazy version of a UUID: its format has not been determined yet, so it is mostly only usable for string/bytes conversion. This object optimizes instantiation, serialization and string conversion time, at the cost of increased overhead for more advanced…
Namespace
Ramsey\Uuid\LazyCode
public static function fromBytes(string $bytes) : self {
$base16Uuid = bin2hex($bytes);
return new self(substr($base16Uuid, 0, 8) . '-' . substr($base16Uuid, 8, 4) . '-' . substr($base16Uuid, 12, 4) . '-' . substr($base16Uuid, 16, 4) . '-' . substr($base16Uuid, 20, 12));
}