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)

11698778-820f-4afc-998b-2b26336bcb52

Best for general purpose use

UUID v7 (Timestamp)

019eb7a6-f2a6-7000-9420-82f38db89b42

Database-optimized sorting

All UUID Versions (Live Generated)

v1 (Time+MAC)
fce7cae0-65b7-11f1-9668-8f4abd36c410
v3 (MD5 Name)
c5e5f349-28ef-3f5a-98d6-0b32ee4d1743
v4 (Random)
efa8c5ac-5d68-4f82-adc2-60b3f5456fa5
v5 (SHA1 Name)
7cb48787-6d91-5b9f-bc60-f30298ea5736
v6 (Reordered)
fce7cc20-65b7-61f1-8a3a-e5910cdb9e99
v7 (Timestamp)
019eb7a6-f2a6-7018-8ec2-a6196b6ee745
v8 (Custom)
c2d2dd3f-d01d-86fb-b006-a5ae2cbac5d2
Nil UUID
00000000-0000-0000-0000-000000000000

Next Steps

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