Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebastianbergmann/uuid
Function for generating a UUID (as string)
https://github.com/sebastianbergmann/uuid
uuid uuid-generator
Last synced: about 1 month 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 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-29T07:07:14.000Z (about 2 months ago)
- Last Synced: 2024-10-01T08:01:20.014Z (about 2 months ago)
- Topics: uuid, uuid-generator
- Language: PHP
- Homepage:
- Size: 23.2 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
[![Latest Stable Version](https://poser.pugx.org/sebastian/uuid/v)](https://packagist.org/packages/sebastian/uuid)
[![CI Status](https://github.com/sebastianbergmann/uuid/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/uuid/actions)
[![codecov](https://codecov.io/gh/sebastianbergmann/uuid/branch/main/graph/badge.svg)](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