{"id":15732798,"url":"https://github.com/nilportugues/php-uuid","last_synced_at":"2025-07-14T15:35:07.230Z","repository":{"id":27285667,"uuid":"30759191","full_name":"nilportugues/php-uuid","owner":"nilportugues","description":"Use this class to encapsulate the latest and more secure Uuid versions","archived":false,"fork":false,"pushed_at":"2017-05-04T20:33:57.000Z","size":22,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T07:39:10.040Z","etag":null,"topics":["composer","php","php7","secure","security","uuid","uuid-generator","uuid4","uuid5"],"latest_commit_sha":null,"homepage":"http://nilportugues.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ppetr/jLens","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nilportugues.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}},"created_at":"2015-02-13T14:14:10.000Z","updated_at":"2022-02-12T14:11:07.000Z","dependencies_parsed_at":"2022-07-12T05:46:12.938Z","dependency_job_id":null,"html_url":"https://github.com/nilportugues/php-uuid","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/nilportugues/php-uuid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilportugues%2Fphp-uuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilportugues%2Fphp-uuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilportugues%2Fphp-uuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilportugues%2Fphp-uuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nilportugues","download_url":"https://codeload.github.com/nilportugues/php-uuid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilportugues%2Fphp-uuid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265312474,"owners_count":23745181,"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":["composer","php","php7","secure","security","uuid","uuid-generator","uuid4","uuid5"],"created_at":"2024-10-04T00:22:45.126Z","updated_at":"2025-07-14T15:35:07.200Z","avatar_url":"https://github.com/nilportugues.png","language":"PHP","funding_links":["https://paypal.me/nilportugues"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/nilportugues/php-uuid.svg)](https://travis-ci.org/nilportugues/php-uuid) [![Coverage Status](https://img.shields.io/coveralls/nilportugues/uuid.svg)](https://coveralls.io/r/nilportugues/uuid) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nilportugues/uuid/badges/quality-score.png)](https://scrutinizer-ci.com/g/nilportugues/uuid/) [![Latest Stable Version](https://poser.pugx.org/nilportugues/uuid/v/stable)](https://packagist.org/packages/nilportugues/uuid) [![Total Downloads](https://poser.pugx.org/nilportugues/uuid/downloads)](https://packagist.org/packages/nilportugues/uuid) [![License](https://poser.pugx.org/nilportugues/uuid/license)](https://packagist.org/packages/nilportugues/uuid) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/ee408e0a-5d08-42ce-9f42-b7a5220b1048/mini.png)](https://insight.sensiolabs.com/projects/ee408e0a-5d08-42ce-9f42-b7a5220b1048)\n[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://paypal.me/nilportugues)\n\n# Uuid Generator\nThis class' intent is to encapsulate Uuid's latest and more secure versions removing the need to explicitly hard-code a Uuid version everywhere.\n\n### 1. Installation\n\nThe recommended way to install the Uuid Generator is through [Composer](http://getcomposer.org). Run the following command to install it:\n\n```sh\nphp composer.phar require nilportugues/uuid\n```\n\n### 2. Usage\n\nUsage is real simple, you can create your Uuid right away or under certain namespaces.\n\n#### 2.1. Without namespacing\nThis is the most common case. Usage is straight-forward:\n\n```php\n\u003c?php\nuse NilPortugues\\Uuid\\Uuid;\n\necho Uuid::create(); // \"13dfa123-d7a6-4082-8b3f-513c28f5d691\"\n```\n\n#### 2.2. With namespacing\nFirst of all, the following namespaces exists:\n\n- DNS Namespace\n- URL Namespace\n- OID (Object Id) Namespace\n- X500 Namespace\n\nCode-wise it's use can be defined using a constant.\n\n```php\n\u003c?php\nuse NilPortugues\\Uuid\\Uuid;\n\necho Uuid::create(Uuid::NAMESPACE_DNS, 'nilportugues.com');\n\necho Uuid::create(Uuid::NAMESPACE_URL, 'http://nilportugues.com/robots.txt');\n\necho Uuid::create(Uuid::NAMESPACE_OID, 'Foo\\Bar');\n\necho Uuid::create(Uuid::NAMESPACE_X500, '/c=us/o=Sun/ou=People/cn=Rosanna Lee');\n```\n\nMore on its usage can be found here: http://tools.ietf.org/html/rfc4122#appendix-C\n\n\n#### 2.3. Uuid versions\nCurrently Uuid has 5 versions and while all of them are valid, usage of newest versions is always preferred. Lastest preferred versions are:\n\n- Uuid4 preferred over Uuid1.\n- Uuid5 preferred over Uuid3 and Uuid1\n\n### 3. Quality\n\nTo run the PHPUnit tests at the command line, go to the tests directory and issue phpunit.\n\nThis library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.\n\n### 4. Author [↑](#index_block)\nNil Portugués Calderó\n\n - \u003ccontact@nilportugues.com\u003e\n - [http://nilportugues.com](http://nilportugues.com)\n\n### 5. License [↑](#index_block)\nThe code base is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilportugues%2Fphp-uuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnilportugues%2Fphp-uuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilportugues%2Fphp-uuid/lists"}