Skip to main content

UUID Package Overview

The DomainFlow\Uuid package provides a structured, type-safe, and version-aware system for generating, validating, and inspecting UUIDs across multiple RFC-compliant versions.

⚙️ Requirements

  • PHP 8.4 or 8.5

✨ Features

  • Support for all major UUID versions (v1 through v8)
  • Deterministic UUID generation (v3, v5)
  • Time-based and sortable UUIDs (v1, v6, v7)
  • Domain-specific UUIDv2 generation (UID/GID)
  • RFC 4122 variant detection and validation
  • RFC 4122 §4.5-compliant multicast bit on randomly generated node IDs (v1, v6)
  • Introspectable metadata with the Inspector class
  • Immutable, final readonly value objects with interface contracts
  • Shared equals(), fromString(), and JSON (de)serialization across every version — see Shared Methods

UUID Implementations

Each UUID version has a corresponding final class:

  • UuidV1: Time-based, includes clock sequence and node
  • UuidV2: DCE Security version using UID/GID
  • UuidV3: Name-based (MD5)
  • UuidV4: Random-based
  • UuidV5: Name-based (SHA-1)
  • UuidV6: Sortable timestamp-based
  • UuidV7: Unix-time-based with random bits
  • UuidV8: Application-defined structure

Inspector

An analysis tool that:

  • Detects UUID version and variant
  • Extracts metadata depending on version
  • Handles relaxed format validation for inspection

This package ensures clean UUID handling with clarity and robustness, helping you integrate UUIDs seamlessly in your DomainFlow-based applications.