UUID Library v1.3.0

Installation Guide

webpatser@dev: ~/uuid/1.3.0 $ cat installation.md

Installation - UUID Library v1.3.0

High-performance PHP UUID library generating UUIDs according to RFC 4122 and RFC 9562 standards. 15% faster than Ramsey UUID.

composer require webpatser/uuid

Requirements

  • PHP 8.2 or higher
  • No additional extensions required
  • Pure PHP implementation

Laravel Integration

Using Laravel?
For tight Laravel integration with automatic model UUIDs, migrations, and optimized features, consider using the Laravel UUID package which includes this library with enhanced Laravel-specific functionality. View Laravel UUID Documentation →

Live Interactive Example

UUID v4 (Random)

539a7bd0-f202-4f31-b94c-230be0e1b148

Best for general purpose use

UUID v7 (Timestamp)

019b3081-134e-700d-858c-baaa4cf73779

Database-optimized sorting

All UUID Versions (Live Generated)

v1 (Time+MAC)
c5837430-dbe8-11f0-ad25-8f4bd075db9f
v3 (MD5 Name)
c5e5f349-28ef-3f5a-98d6-0b32ee4d1743
v4 (Random)
10edd4ac-4abe-4b34-be5e-84425b6ee357
v5 (SHA1 Name)
7cb48787-6d91-5b9f-bc60-f30298ea5736
v6 (Reordered)
c58374d0-dbe8-61f0-b631-e5ff94b3d623
v7 (Timestamp)
019b3081-134e-701a-89f5-86d3c6b753c9
v8 (Custom)
4e543bc7-127a-894d-8e49-b13a58aca308
Nil UUID
00000000-0000-0000-0000-000000000000

Next Steps

Explore the UUID library features and generate different UUID types interactively with the examples above.