Download the PHP package projectsaturnstudios/quickuuid without Composer
On this page you can find all versions of the php package projectsaturnstudios/quickuuid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download projectsaturnstudios/quickuuid
More information about projectsaturnstudios/quickuuid
Files in projectsaturnstudios/quickuuid
Package quickuuid
Short Description Simple helper functions to easily generate UUIDs (v4 and v5).
License MIT
Informations about the package quickuuid
ProjectSaturnStudios/QuickUUID
A simple PHP library providing helper functions to easily generate version 4 (random) and version 5 (name-based, SHA-1) UUIDs. It leverages the robust ramsey/uuid package under the hood.
Features
- Generate UUIDv4.
- Generate UUIDv5 with a specified name and an optional namespace.
- A primary helper
new_uuid()that intelligently calls either v4 or v5 generation based on provided arguments. - Configurable default namespace for UUIDv5 generation.
Installation
Install the package via Composer:
Basic Usage
UUIDv5 Namespace Configuration
The new_uuid5() and new_uuid() (when generating a v5 UUID) functions use a default namespace. This default is Ramsey\Uuid\Uuid::NAMESPACE_DNS.
You can change this application-wide default by defining the QUICKUUID_DEFAULT_V5_NAMESPACE constant before the quickuuid/src/Helpers/helpers.php file is loaded by Composer. Make sure the value you define is a valid UUID string.
Example (e.g., in your bootstrap/app.php or an early Composer autoloaded file):
Dependencies
- PHP ^8.2
ramsey/uuid: ^4.7
Running Quality Assurance
This package uses PHPUnit for tests and PHPStan for static analysis.
To run tests:
To run static analysis:
License
This package is licensed under the MIT License. See the LICENSE.md file for details.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue.