{"id":15509119,"url":"https://github.com/devuri/uuid-generator","last_synced_at":"2026-05-05T06:32:59.616Z","repository":{"id":107175342,"uuid":"609535025","full_name":"devuri/uuid-generator","owner":"devuri","description":"The UUIDGenerator class is a secure and efficient way to generate UUIDs (Universally Unique Identifiers) in PHP. It generates UUIDs according to the RFC 4122 standard, which ensures that the UUIDs are unique across time and space.","archived":false,"fork":false,"pushed_at":"2023-03-04T14:08:29.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-25T00:56:01.258Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devuri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-04T13:25:06.000Z","updated_at":"2023-03-04T14:40:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e292a1b-17f2-4181-a0de-33a0b5cb7f5d","html_url":"https://github.com/devuri/uuid-generator","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"b369043c598110e70f16e3689a4040e2c2e483bb"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devuri%2Fuuid-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devuri%2Fuuid-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devuri%2Fuuid-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devuri%2Fuuid-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devuri","download_url":"https://codeload.github.com/devuri/uuid-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244991175,"owners_count":20543627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T09:41:25.500Z","updated_at":"2026-05-05T06:32:54.580Z","avatar_url":"https://github.com/devuri.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"UUIDGenerator\n=============\n\nThe `UUIDGenerator` class is a secure and efficient way to generate UUIDs (Universally Unique Identifiers) in PHP. It generates UUIDs according to the RFC 4122 standard, which ensures that the UUIDs are unique across time and space.\n\n### Installation\n\nYou can install the `UUIDGenerator` class using Composer. Run the following command in your terminal:\n\n    composer require devuri/uuid-generator\n\nAlternatively, you can manually include the `UUIDGenerator` class in your PHP project.\n\n### Usage\n\nTo use the `UUIDGenerator` class, first import the class using the `use` keyword:\n```php\nuse Devuri\\UUIDGenerator\\UUIDGenerator;\n```\nThen, create a new instance of the `UUIDGenerator` class:\n```php\n$uuidGenerator = new UUIDGenerator();\n```\nYou can optionally specify the version and variant of the UUID you want to generate. The version determines the layout of the UUID, while the variant determines the encoding of the UUID. The default version is 4 (random), and the default variant is the RFC 4122 variant.\n```php\n$uuidGenerator = new UUIDGenerator(1, 0x80);\n```\nTo generate a new UUID, call the `generateUUID()` method:\n```php\n$uuid = $uuidGenerator-\u003egenerateUUID();\n```\nThe generateUUID() method returns a string in the following format:\n```shell\nxxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx\n```\nWhere:\n\n*   `**x**` is a hexadecimal digit **(0-9, a-f)**\n*   `**M**` is the version number **(1-5)**\n*   **`N`** is the variant number **(8, 9, a, b)**\n\n### Example\n\nHere's an example of how to use the `UUIDGenerator` class to generate a new UUID:\n```php\n    use Devuri\\UUIDGenerator\\UUIDGenerator;\n    \n    $uuidGenerator = new UUIDGenerator();\n    $uuid = $uuidGenerator-\u003egenerateUUID();\n    \n    echo $uuid;\n```\nThis code creates a new instance of the `UUIDGenerator` class, generates a new UUID, and then prints the UUID to the screen.\n\n### Security\n\nThe `UUIDGenerator` class uses a secure and efficient method to generate UUIDs. It generates random bytes using the `random_bytes()` function, which is a cryptographically secure random number generator. It then sets the version and variant bits according to the RFC 4122 standard.\n\n### License\n\nThe `UUIDGenerator` class is open-source software licensed under the MIT License. See the `LICENSE` file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevuri%2Fuuid-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevuri%2Fuuid-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevuri%2Fuuid-generator/lists"}