{"id":21037348,"url":"https://github.com/macx/rfc-4122-uuid","last_synced_at":"2025-05-15T14:32:44.280Z","repository":{"id":21878302,"uuid":"25201939","full_name":"macx/rfc-4122-uuid","owner":"macx","description":"PHP-Class to generate valid RFC 4122 compliant Universally Unique IDentifiers (UUID) version 3, 4 and 5.","archived":false,"fork":false,"pushed_at":"2014-10-30T14:46:20.000Z","size":157,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T05:47:48.882Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/macx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-14T10:46:16.000Z","updated_at":"2021-05-31T11:50:36.000Z","dependencies_parsed_at":"2022-08-17T22:05:06.321Z","dependency_job_id":null,"html_url":"https://github.com/macx/rfc-4122-uuid","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macx%2Frfc-4122-uuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macx%2Frfc-4122-uuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macx%2Frfc-4122-uuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macx%2Frfc-4122-uuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macx","download_url":"https://codeload.github.com/macx/rfc-4122-uuid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254359012,"owners_count":22058032,"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-11-19T13:25:46.242Z","updated_at":"2025-05-15T14:32:43.952Z","avatar_url":"https://github.com/macx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RFC 4122 UUID\n\nThe following class generates VALID RFC 4122 COMPLIANT\nUniversally Unique IDentifiers (UUID) version 3, 4 and 5.\n\nUUIDs generated validates using OSSP UUID Tool, and output\nfor named-based UUIDs are exactly the same. This is a pure\nPHP implementation.\n\nAuthor: [Andrew Moore](https://github.com/FineWolf?)\nposted this as a [note](http://www.php.net/manual/en/function.uniqid.php#94959) at the PHP Manual back in 2010.\n\n## Install\n\nIf you're using [Composer](https://getcomposer.org/) as a package manager for PHP, put this require directive in your `composer.json` and run `composer install` in your CLI.\n\n```json\n{\n  \"require\" : {\n    \"macx/rfc-4122-uuid\" : \"1.0.*\"\n  }\n}\n```\n\nOr require it via command line with:\n\n```bash\n$ composer require macx/rfc-4122-uuid 1.0.*\n```\n\n## Generate a unique ID\n\nTo generate a ID simply copy the following code:\n\n```php\ninclude 'vendor/autoload.php';\n\n$uuid = macx\\UUID::v4();\n\necho 'The generated UUID is `' . $uuid . '`';\n```\n\nIf you want to validate a ID against RFC do this:\n\n```php\n$givenId = 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6';\n\nif(macx\\UUID::is_valid($givenId)) {\n  // do something\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacx%2Frfc-4122-uuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacx%2Frfc-4122-uuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacx%2Frfc-4122-uuid/lists"}