gitmyhub

uuid

PHP ★ 13k updated 3d ago

:snowflake: A PHP library for generating universally unique identifiers (UUIDs).

A PHP library for generating and working with UUIDs, globally unique identifiers used as database primary keys and API resource labels, installed via one Composer command.

PHPComposersetup: easycomplexity 1/5

ramsey/uuid is a PHP library for generating and working with UUIDs. A UUID (universally unique identifier) is a 128-bit number used to label records, files, or other items in a way that is extremely unlikely to collide with any other identifier, even across different systems and databases. They appear as strings of hexadecimal characters separated by hyphens, in a format like "550e8400-e29b-41d4-a716-446655440000". Developers commonly use them as primary keys in databases, as identifiers for API resources, or anywhere a globally unique label is needed without a central registry assigning the numbers.

The library is installed through Composer, which is the standard package manager for PHP projects. One command adds it as a dependency and registers it in your project's composer.json file. The library requires PHP 8 or above based on the package metadata. Full documentation, usage examples, and a FAQ are hosted at uuid.ramsey.dev rather than in this repository, so the README itself is intentionally brief.

The current major version is 4. An upgrade guide exists for anyone moving from version 3 to version 4, linked from the README. The project was inspired by UUID libraries in Java and Python. It follows a published code of conduct for contributors and maintainers.

The library is released under the MIT license, meaning it can be used freely in both open-source and commercial PHP applications. Commercial support and maintenance coverage are also available through a Tidelift subscription for teams that need guaranteed long-term support for their open-source dependencies.

Where it fits