https://github.com/sebastianbergmann/uuid
Function for generating a UUID (as string)
https://github.com/sebastianbergmann/uuid
uuid uuid-generator
Last synced: 5 months ago
JSON representation
Function for generating a UUID (as string)
- Host: GitHub
- URL: https://github.com/sebastianbergmann/uuid
- Owner: sebastianbergmann
- License: bsd-3-clause
- Created: 2023-03-21T07:17:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-01T09:45:09.000Z (6 months ago)
- Last Synced: 2025-01-29T18:38:17.465Z (6 months ago)
- Topics: uuid, uuid-generator
- Language: PHP
- Homepage:
- Size: 23.8 MB
- Stars: 27
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://packagist.org/packages/sebastian/uuid)
[](https://github.com/sebastianbergmann/uuid/actions)
[](https://codecov.io/gh/sebastianbergmann/uuid)# sebastian/uuid
This package provides a single function: `uuid()`. This function uses PHP's `random_bytes()` function to generate a string that contains a 16-byte number written in hexadecimal and divided into five groups of characters (8-4-4-4-12).
Strings generated using the `uuid()` function can be used as Universally Unique Identifiers (UUIDs) in certain contexts.
## Installation
You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):
```
composer require sebastian/uuid
```If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:
```
composer require --dev sebastian/uuid
```## Usage
```php