qerbia/quuid

A PHP library to generate, validate, and decode QUUIDs-a custom UUID format that embeds record IDs while maintaining compatibility with the UUID v8 standard.

v1.0.0 2025-01-25 22:15 UTC

This package is auto-updated.

Last update: 2025-05-25 23:01:56 UTC


README

Qerbia QUUID is a specialized UUID (Unique Identifier) library that provides a custom UUID8 implementation with embedded integer encoding capabilities.

Contents

Features

  • Generate custom UUID8-compatible identifiers
  • Encode and decode integer IDs within UUID strings
  • Supports unique identifier generation with embedded data
  • Strictly validates QUUID format

Requirements

  • PHP 7.1+
  • Supports strict typing

Installation

composer require qerbia/quuid

Usage

Decoding a QUUID

<?php

use Qerbia\Quuid\Quuid;

$quuid = new Qerbia\Quuid\Quuid();
$id = $quuid->decode('0d1b4268-e341-8873-9661-185378350c35');
// Returns an integer ID (e.g., 15)

Supported Ranges

  • Minimum Encoded ID: 0
  • Maximum Encoded ID: 4,294,967,295 (32-bit unsigned integer)

Validation

The library provides strict validation for:

  • UUID8 format compliance
  • QUUID character restrictions