PHPackages                             highperapp/uuid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. highperapp/uuid

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

highperapp/uuid
===============

High-performance UUID generator library implementing RFC 9562 with optional Rust FFI acceleration

1.1.1(10mo ago)014MITPHPPHP ^8.3

Since Jul 4Pushed 10mo agoCompare

[ Source](https://github.com/highperapp/uuid)[ Packagist](https://packagist.org/packages/highperapp/uuid)[ RSS](/packages/highperapp-uuid/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

UUID Library
============

[](#uuid-library)

A high-performance UUID generator library implementing RFC 9562 with support for UUIDv1-v8, featuring optional Rust FFI acceleration, async/sync compatibility, and high-concurrency collision prevention.

Features
--------

[](#features)

- ✅ **Complete RFC 9562 Support**: UUIDv1, v3, v4, v5, v6, v7, v8
- ⚡ **High Performance**: Optional Rust FFI acceleration
- 🔄 **Async/Sync Compatible**: Works with both paradigms seamlessly
- 🚀 **Concurrency Support**: RevoltPHP, AmphpV3, Parallel integration
- 🛡️ **Collision Prevention**: Advanced mechanisms for high-throughput scenarios
- 🔧 **Configurable**: Multiple RNG providers and performance options
- 📦 **Zero Dependencies**: Pure PHP fallback when FFI unavailable
- ✅ **PHP 8.3+ Compatible**: Supports PHP 8.3 and later versions

Installation
------------

[](#installation)

```
composer require highperapp/uuid
```

### Optional: Rust FFI Acceleration

[](#optional-rust-ffi-acceleration)

For maximum performance, you can enable Rust FFI acceleration which can improve UUID generation speed by up to 10x.

#### Prerequisites

[](#prerequisites)

1. **Install PHP FFI Extension** (required for Rust acceleration):

    ```
    # Ubuntu/Debian
    sudo apt update
    sudo apt install php8.3-ffi php8.3-dev

    # CentOS/RHEL/Fedora
    sudo yum install php-ffi php-devel
    # or for newer versions:
    sudo dnf install php-ffi php-devel

    # macOS (with Homebrew)
    brew install php
    # FFI is usually included in modern PHP builds

    # Windows
    # Enable FFI in php.ini by uncommenting:
    # extension=ffi
    ```
2. **Verify FFI Installation**:

    ```
    php -m | grep ffi
    # Should output: ffi

    # Test FFI functionality
    php -r "echo extension_loaded('ffi') ? 'FFI enabled' : 'FFI not available';"
    ```
3. **Install Rust** (if not already installed):

    ```
    # Using rustup (recommended)
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source $HOME/.cargo/env

    # Or using your system package manager
    # Ubuntu/Debian: sudo apt install rustc cargo
    # macOS: brew install rust
    # Windows: Download from https://rustup.rs/
    ```
4. **Verify Installation**:

    ```
    rustc --version
    cargo --version
    ```

#### Build the Rust Library

[](#build-the-rust-library)

```
cd rust
cargo build --release
```

The compiled library will be available at `rust/target/release/libuuid_ffi.so` (Linux/macOS) or `rust/target/release/uuid_ffi.dll` (Windows).

#### Troubleshooting FFI Issues

[](#troubleshooting-ffi-issues)

If you encounter FFI-related errors:

1. **FFI Not Available**:

    ```
    # Check if FFI is installed
    php -m | grep ffi

    # Check PHP configuration
    php --ini | grep "Configuration File"

    # Enable FFI in php.ini
    echo "extension=ffi" | sudo tee -a /etc/php/8.3/cli/php.ini
    ```
2. **FFI Preloading Issues**:

    ```
    # Set FFI preload in php.ini (optional for better performance)
    echo "ffi.preload=" | sudo tee -a /etc/php/8.3/cli/php.ini
    ```
3. **Permission Issues**:

    ```
    # Ensure the compiled library has proper permissions
    chmod +x rust/target/release/libuuid_ffi.so
    ```
4. **Library Path Issues**:

    ```
    // Test FFI with absolute path
    $ffi = FFI::cdef("", __DIR__ . "/rust/target/release/libuuid_ffi.so");
    ```

#### Development vs Production

[](#development-vs-production)

- **Development**: The library automatically falls back to pure PHP if Rust FFI is unavailable
- **Production**: For optimal performance, ensure both FFI extension and Rust library are available
- **CI/CD**: Add both FFI installation and Rust build steps to your deployment pipeline
- **Docker**: Include FFI in your PHP Docker image and build Rust during image creation

Quick Start
-----------

[](#quick-start)

```
use HighPerApp\HighPer\Uuid\Core\UuidFactory;

// Generate UUIDs
$uuid4 = UuidFactory::v4();  // Random UUID
$uuid7 = UuidFactory::v7();  // Timestamp-based UUID (recommended)
$uuid1 = UuidFactory::v1();  // Legacy timestamp + MAC

// Name-based UUIDs
$uuid3 = UuidFactory::v3(UuidFactory::NAMESPACE_DNS, 'example.com');
$uuid5 = UuidFactory::v5(UuidFactory::NAMESPACE_DNS, 'example.com');

// Convert and validate
$uuid = UuidFactory::fromString('550e8400-e29b-41d4-a716-446655440000');
$isValid = UuidFactory::isValid($uuid->toString());

echo $uuid->toString();   // 550e8400-e29b-41d4-a716-446655440000
echo $uuid->getVersion(); // 4
```

UUID Versions
-------------

[](#uuid-versions)

### UUIDv1 - Timestamp + MAC Address

[](#uuidv1---timestamp--mac-address)

```
$uuid = UuidFactory::v1();
echo $uuid->getTimestamp(); // Gregorian timestamp
echo $uuid->getNode();      // MAC address (or random)
```

### UUIDv3 - MD5 Name-based

[](#uuidv3---md5-name-based)

```
$uuid = UuidFactory::v3Dns('example.com');
// Always generates the same UUID for the same input
```

### UUIDv4 - Random

[](#uuidv4---random)

```
$uuid = UuidFactory::v4();
// Cryptographically random
```

### UUIDv5 - SHA-1 Name-based

[](#uuidv5---sha-1-name-based)

```
$uuid = UuidFactory::v5Url('https://example.com');
// Always generates the same UUID for the same input
```

### UUIDv6 - Reordered Timestamp

[](#uuidv6---reordered-timestamp)

```
$uuid = UuidFactory::v6();
// Like v1 but with better database locality
```

### UUIDv7 - Unix Timestamp (Recommended)

[](#uuidv7---unix-timestamp-recommended)

```
$uuid = UuidFactory::v7();
// Best for new applications - sortable and efficient
```

### UUIDv8 - Custom Format

[](#uuidv8---custom-format)

```
$uuid = UuidFactory::v8([
    'custom_fields' => [
        'timestamp' => time(),
        'counter' => 123
    ]
]);
```

Performance Configuration
-------------------------

[](#performance-configuration)

### High Performance Setup

[](#high-performance-setup)

```
use HighPerApp\HighPer\Uuid\Core\Configuration;
use HighPerApp\HighPer\Uuid\Core\UuidFactory;

$config = Configuration::highPerformance();
UuidFactory::configure($config);

// Now all UUID generation uses Rust FFI when available
$uuid = UuidFactory::v4(); // Uses Rust acceleration
```

### Custom Configuration

[](#custom-configuration)

```
$config = Configuration::default()
    ->setDefaultVersion(7)
    ->setRandomProvider('rust')
    ->enableFFI(true)
    ->setMaxConcurrentWorkers(8);

UuidFactory::configure($config);
```

Thread-Safe Operations
----------------------

[](#thread-safe-operations)

For concurrent environments (Swoole, ReactPHP, etc.), use the thread-safe factory:

```
use HighPerApp\HighPer\Uuid\Core\ThreadSafeUuidFactory;

// Safe for concurrent environments
$factory = ThreadSafeUuidFactory::getInstance();
$uuid = $factory->v4();

// Or use static convenience methods
$uuid = ThreadSafeUuidFactory::createV4();
$uuid = ThreadSafeUuidFactory::createV7();
```

Async/Concurrent Generation
---------------------------

[](#asyncconcurrent-generation)

### Prerequisites for Async Features

[](#prerequisites-for-async-features)

Install optional async dependencies for enhanced capabilities:

```
composer require revolt/event-loop amphp/amp amphp/parallel
```

### Async Generation

[](#async-generation)

```
use HighPerApp\HighPer\Uuid\Async\AsyncUuidFactory;

// Check if async is available
if (AsyncUuidFactory::isAsyncAvailable()) {
    // Single async UUID
    $uuid = AsyncUuidFactory::v4Async()->await();
    $uuid = AsyncUuidFactory::v7Async()->await();

    // Batch generation (non-blocking)
    $uuids = AsyncUuidFactory::generateBatch(1000, 4)->await();

    // Concurrent batch with worker processes
    $uuids = AsyncUuidFactory::generateConcurrentBatch(10000, 4, 8)->await();
} else {
    // Fallback to synchronous
    $uuids = AsyncUuidFactory::generateBatchLegacy(1000, 4);
}
```

### High-Throughput Scenarios

[](#high-throughput-scenarios)

```
use HighPerApp\HighPer\Uuid\Async\TrueConcurrentGenerator;

// True parallel processing (requires amphp/parallel)
$generator = new TrueConcurrentGenerator(8); // 8 worker processes
$uuids = $generator->generateConcurrent(100000, 4);
// Generates 100,000 UUIDs across 8 actual parallel processes
```

### Pipeline Processing

[](#pipeline-processing)

```
use HighPerApp\HighPer\Uuid\Async\AsyncUuidFactory;

// Stream-based generation with non-blocking yields
foreach (AsyncUuidFactory::generatePipeline(10000, 7, 1000) as $uuid) {
    // Process each UUID as it's generated
    // Automatically yields control between batches
    echo $uuid->toString() . "\n";
}
```

### Async Configuration

[](#async-configuration)

```
use HighPerApp\HighPer\Uuid\Configuration\AsyncConfiguration;

// Configure for high-throughput
$config = AsyncConfiguration::highThroughput();
AsyncUuidFactory::configure($config);

// Or custom configuration
$config = new AsyncConfiguration([
    'defaultWorkerCount' => 8,
    'batchSize' => 5000,
    'enableEntropyPool' => true,
    'enableParallel' => true,
]);

// Get optimal settings for your system
$optimal = $config->getOptimalWorkerCount(); // Auto-detects CPU cores
$batchSize = $config->getOptimalBatchSize(100000);
```

Random Number Providers
-----------------------

[](#random-number-providers)

```
use HighPerApp\HighPer\Uuid\RandomProvider\RandomProviderFactory;

// Available providers
$providers = RandomProviderFactory::getAvailableProviders();
// ['secure', 'openssl', 'rust', 'pseudo']

// Create specific provider
$provider = RandomProviderFactory::create('rust');
$uuid = UuidFactory::v4($provider);

// Benchmark providers
$results = RandomProviderFactory::benchmark('rust', 1000);
```

Collision Prevention
--------------------

[](#collision-prevention)

The library includes advanced collision prevention mechanisms:

```
use HighPerApp\HighPer\Uuid\Concurrency\CollisionPrevention;

// Enable collision detection
$config = Configuration::default()
    ->enableCollisionPrevention(true);
UuidFactory::configure($config);

// The library automatically handles:
// - Timestamp collisions
// - High-frequency generation
// - Multi-process safety
// - Sequence management
```

Benchmarking
------------

[](#benchmarking)

Run performance tests to validate performance on your system:

```
# Run built-in benchmarks (requires PHPBench)
vendor/bin/phpbench run benchmarks --report=default

# Quick performance test
php -r "
require 'vendor/autoload.php';
use HighPerApp\HighPer\Uuid\Core\UuidFactory;
\$start = microtime(true);
for (\$i = 0; \$i < 10000; \$i++) { UuidFactory::v4(); }
\$duration = microtime(true) - \$start;
echo 'Generated ' . number_format(10000 / \$duration) . ' UUIDs/second\n';
"
```

### Expected Performance Ranges

[](#expected-performance-ranges)

- **Development environment**: 300,000 - 600,000 UUIDs/second
- **Production environment**: 600,000 - 900,000 UUIDs/second
- **With Rust FFI**: 1,000,000+ UUIDs/second
- **High-concurrency scenarios**: 400,000 - 800,000 UUIDs/second

Performance depends on:

- CPU speed and architecture
- PHP version and configuration
- Available memory
- FFI extension availability
- Rust library compilation

Integration Examples
--------------------

[](#integration-examples)

### Laravel

[](#laravel)

```
// In a Laravel service provider
use HighPerApp\HighPer\Uuid\Core\ThreadSafeUuidFactory;
use HighPerApp\HighPer\Uuid\Async\AsyncUuidFactory;
use HighPerApp\HighPer\Uuid\Configuration\AsyncConfiguration;

public function register()
{
    // Register thread-safe factory
    $this->app->singleton(ThreadSafeUuidFactory::class, function() {
        return ThreadSafeUuidFactory::getInstance();
    });
}

public function boot()
{
    // Configure async capabilities if available
    if (AsyncUuidFactory::isAsyncAvailable()) {
        AsyncUuidFactory::configure(AsyncConfiguration::highThroughput());
    }
}

// In your models
protected $keyType = 'string';
public $incrementing = false;

protected static function boot()
{
    parent::boot();

    static::creating(function ($model) {
        if (empty($model->id)) {
            $factory = app(ThreadSafeUuidFactory::class);
            $model->id = $factory->v7()->toString();
        }
    });
}

// In queue jobs for bulk operations
class BulkUuidGenerationJob
{
    public function handle()
    {
        if (AsyncUuidFactory::isAsyncAvailable()) {
            $uuids = AsyncUuidFactory::generateConcurrentBatch(50000, 7, 4)->await();
        } else {
            $uuids = AsyncUuidFactory::generateBatchLegacy(50000, 7);
        }

        // Process the UUIDs
    }
}
```

### Symfony

[](#symfony)

```
# config/services.yaml
services:
    HighPerApp\HighPer\Uuid\Core\ThreadSafeUuidFactory:
        factory: ['HighPerApp\HighPer\Uuid\Core\ThreadSafeUuidFactory', 'getInstance']

    async_uuid_config:
        class: HighPerApp\HighPer\Uuid\Configuration\AsyncConfiguration
        factory: ['HighPerApp\HighPer\Uuid\Configuration\AsyncConfiguration', 'balanced']
```

```
// In a service or controller
use HighPerApp\HighPer\Uuid\Core\ThreadSafeUuidFactory;
use HighPerApp\HighPer\Uuid\Async\AsyncUuidFactory;

class UuidService
{
    public function __construct(
        private ThreadSafeUuidFactory $uuidFactory
    ) {}

    public function generateSingle(): string
    {
        return $this->uuidFactory->v7()->toString();
    }

    public async function generateBatch(int $count): array
    {
        if (AsyncUuidFactory::isAsyncAvailable()) {
            return AsyncUuidFactory::generateBatch($count, 7)->await();
        }

        return AsyncUuidFactory::generateBatchLegacy($count, 7);
    }
}
```

### Swoole/OpenSwoole Integration

[](#swooleopenswoole-integration)

```
use Swoole\Http\Server;
use HighPerApp\HighPer\Uuid\Core\ThreadSafeUuidFactory;
use HighPerApp\HighPer\Uuid\Async\AsyncUuidFactory;

$server = new Server("127.0.0.1", 9501);

$server->on('WorkerStart', function($server, $workerId) {
    // Reset static state for each worker
    ThreadSafeUuidFactory::resetInstance();
    AsyncUuidFactory::reset();
});

$server->on('Request', function($request, $response) {
    // Thread-safe UUID generation
    $factory = ThreadSafeUuidFactory::getInstance();
    $uuid = $factory->v7()->toString();

    $response->end("Generated UUID: {$uuid}");
});

$server->start();
```

### ReactPHP Integration

[](#reactphp-integration)

```
use React\EventLoop\Loop;
use React\Http\HttpServer;
use HighPerApp\HighPer\Uuid\Core\ThreadSafeUuidFactory;
use HighPerApp\HighPer\Uuid\Async\AsyncUuidFactory;

$loop = Loop::get();

$server = new HttpServer(function($request) {
    return new Promise(function($resolve) {
        if (AsyncUuidFactory::isAsyncAvailable()) {
            // Non-blocking UUID generation
            AsyncUuidFactory::generateBatch(1000, 7)->then(function($uuids) use ($resolve) {
                $resolve(new Response(200, [], json_encode($uuids)));
            });
        } else {
            // Fallback to thread-safe synchronous
            $factory = ThreadSafeUuidFactory::getInstance();
            $uuids = [];
            for ($i = 0; $i < 1000; $i++) {
                $uuids[] = $factory->v7()->toString();
            }
            $resolve(new Response(200, [], json_encode($uuids)));
        }
    });
});

$socket = new SocketServer('127.0.0.1:8080', [], $loop);
$server->listen($socket);
$loop->run();
```

### Database Storage

[](#database-storage)

```
-- MySQL
CREATE TABLE users (
    id BINARY(16) PRIMARY KEY,
    uuid_string CHAR(36) GENERATED ALWAYS AS (
        CONCAT(
            HEX(SUBSTR(id, 1, 4)), '-',
            HEX(SUBSTR(id, 5, 2)), '-',
            HEX(SUBSTR(id, 7, 2)), '-',
            HEX(SUBSTR(id, 9, 2)), '-',
            HEX(SUBSTR(id, 11, 6))
        )
    ) STORED,
    name VARCHAR(255)
);

-- PostgreSQL
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE users (
    id UUID PRIMARY KEY,
    name VARCHAR(255)
);
```

Performance Characteristics
---------------------------

[](#performance-characteristics)

VersionPerformanceUse CaseSortableCollision Riskv1HighLegacy systemsNoVery Lowv3MediumName-based, reproducibleNoNonev4HighGeneral purposeNoNegligiblev5MediumName-based, reproducibleNoNonev6HighSortable timestampYesVery Lowv7**Highest****Recommended for new apps****Yes****Very Low**v8VariableCustom implementationsVariableVariable### Throughput Benchmarks

[](#throughput-benchmarks)

*Benchmarks measured on PHP 8.3.6, Linux x86\_64. Performance may vary based on hardware and configuration.*

ConfigurationUUIDs/secondMemory/UUIDNotesPure PHP v4~600,000-900,000&lt;100 bytesActual performance exceeds estimatesPure PHP v7~700,000-900,000&lt;100 bytesRecommended for new applicationsPure PHP v1~600,000&lt;100 bytesLegacy timestamp-basedPure PHP v3/v5~850,000-900,000&lt;100 bytesName-based UUIDs (cached)Rust FFI v4~1,000,000+&lt;50 bytesRequires FFI extension + Rust buildRust FFI v7~1,200,000+&lt;50 bytesOptimal for high-throughput scenariosConcurrent v4~400,000-800,000VariableDepends on worker count and overhead**Memory Usage Notes:**

- Memory per UUID is minimal in normal usage due to PHP's garbage collection
- Bulk operations (10,000+ UUIDs) may use ~100-200 bytes per UUID temporarily
- String representation adds ~36 bytes per UUID when stored
- Memory usage scales linearly with batch size

Configuration Options
---------------------

[](#configuration-options)

```
$config = new Configuration();

// Version settings
$config->setDefaultVersion(7);              // Default: 7

// Performance settings
$config->enableFFI(true);                   // Default: true
$config->preferRustFFI(true);               // Default: true
$config->setMaxConcurrentWorkers(8);        // Default: 4

// Security settings
$config->setRandomProvider('secure');       // Default: 'secure'
$config->enableCollisionPrevention(true);   // Default: true

// Timestamp settings
$config->enableMonotonicTimestamp(true);    // Default: true
$config->setTimestampPrecision(1000);       // microseconds

// Namespaces
$config->addNamespace('custom', 'your-namespace-uuid');
```

Error Handling
--------------

[](#error-handling)

```
use HighPerApp\HighPer\Uuid\Exception\GenerationException;
use HighPerApp\HighPer\Uuid\Exception\ValidationException;
use HighPerApp\HighPer\Uuid\Exception\ConfigurationException;

try {
    $uuid = UuidFactory::v3('invalid-namespace', 'name');
} catch (ValidationException $e) {
    // Handle validation errors
}

try {
    $uuid = UuidFactory::generate(99); // Invalid version
} catch (GenerationException $e) {
    // Handle generation errors
}
```

Development Setup
-----------------

[](#development-setup)

### Prerequisites

[](#prerequisites-1)

1. **PHP 8.3+** with extensions:

    ```
    # Check required extensions
    php -m | grep -E "(ffi|openssl|json)"

    # Install missing extensions (Ubuntu/Debian)
    sudo apt install php8.3-ffi php8.3-openssl php8.3-json php8.3-dev

    # CentOS/RHEL/Fedora
    sudo yum install php-ffi php-openssl php-json php-devel

    # macOS (with Homebrew)
    brew install php

    # Verify FFI is working
    php -r "echo extension_loaded('ffi') ? 'FFI: ✓' : 'FFI: ✗';"
    ```
2. **Composer** (for PHP dependencies):

    ```
    composer install
    ```
3. **Rust** (optional, for FFI acceleration):

    ```
    # Install Rust if not already installed
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source $HOME/.cargo/env

    # Build the Rust library
    cd rust && cargo build --release

    # Verify Rust FFI library is built
    ls -la rust/target/release/libuuid_ffi.so
    ```

### Development Workflow

[](#development-workflow)

```
# 1. Install dependencies
composer install

# 2. (Optional) Build Rust FFI for performance
cd rust && cargo build --release && cd ..

# 3. Run tests
vendor/bin/phpunit

# 4. Run static analysis
vendor/bin/phpstan analyse
```

Testing
-------

[](#testing)

```
# Run tests
vendor/bin/phpunit

# Run with coverage
vendor/bin/phpunit --coverage-html coverage

# Run benchmarks
vendor/bin/phpbench run benchmarks --report=default

# Static analysis
vendor/bin/phpstan analyse
```

Requirements
------------

[](#requirements)

### Core Requirements

[](#core-requirements)

- PHP 8.3 or higher
- `ext-openssl` (required for secure random generation)
- `ext-json` (required for configuration)

### Optional Dependencies

[](#optional-dependencies)

- `ext-ffi` (optional, for Rust FFI acceleration)
- `revolt/event-loop` ^1.0 (optional, for async operations)
- `amphp/amp` ^3.0 (optional, for async operations)
- `amphp/parallel` ^2.0 (optional, for concurrent processing)

**Note**: The library works perfectly without optional dependencies, providing graceful fallbacks.

### FFI Configuration

[](#ffi-configuration)

For production environments, consider adding these settings to your `php.ini`:

```
# Enable FFI extension
extension=ffi

# Optional: Preload FFI for better performance
; ffi.preload=

# Optional: Set FFI scope (default is "preload")
; ffi.enable=preload
```

Contributing
------------

[](#contributing)

1. Fork the repository
2. Create a feature branch
3. Add tests for new functionality
4. Ensure all tests pass
5. Submit a pull request

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance54

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

318d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbe04e216b4fb74f076a82bb6bd06f96faa4066089b33082c43f8c9cf184efbf?d=identicon)[raghuveer](/maintainers/raghuveer)

---

Top Contributors

[![raghuveer](https://avatars.githubusercontent.com/u/999229?v=4)](https://github.com/raghuveer "raghuveer (3 commits)")

---

Tags

concurrentperformanceuuidguidrustrfc9562ffi

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/highperapp-uuid/health.svg)

```
[![Health](https://phpackages.com/badges/highperapp-uuid/health.svg)](https://phpackages.com/packages/highperapp-uuid)
```

###  Alternatives

[ramsey/uuid

A PHP library for generating and working with universally unique identifiers (UUIDs).

12.6k700.2M3.3k](/packages/ramsey-uuid)[webpatser/laravel-uuid

Laravel integration for webpatser/uuid - High-performance drop-in UUID replacements (15% faster than Ramsey). Provides Str macros, HasUuids trait, facades, and casts. RFC 4122/9562 compliant.

1.8k17.3M129](/packages/webpatser-laravel-uuid)[pascaldevink/shortuuid

PHP 7.4+ library that generates concise, unambiguous, URL-safe UUIDs

5951.8M15](/packages/pascaldevink-shortuuid)[emadadly/laravel-uuid

laravel uuid a simple, automatic UUID generator for any model based on Laravel.

120415.9k3](/packages/emadadly-laravel-uuid)[keiko/uuid-shortener

A simple shortener library for RFC 4122 compatible UUIDs. Change your 36 chars long UUID into it's shorter equivalent.

150215.4k2](/packages/keiko-uuid-shortener)[oittaa/uuid

A small PHP class for generating RFC 9562 universally unique identifiers (UUID) from version 3 to version 8.

50302.7k5](/packages/oittaa-uuid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
