{"id":17477413,"url":"https://github.com/jhuntdev/uuidv9-php","last_synced_at":"2025-03-28T11:45:55.525Z","repository":{"id":258078644,"uuid":"874119371","full_name":"jhuntdev/uuidv9-php","owner":"jhuntdev","description":"Fast, lightweight, zero-dependency PHP implementation of UUID version 9","archived":false,"fork":false,"pushed_at":"2024-10-17T10:59:38.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-20T03:45:44.320Z","etag":null,"topics":["php","uuid","v9"],"latest_commit_sha":null,"homepage":"https://uuidv9.jhunt.dev","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/jhuntdev.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":"2024-10-17T09:33:55.000Z","updated_at":"2024-10-17T10:59:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"e664c5ae-6106-4172-be7e-23ccc4bf8461","html_url":"https://github.com/jhuntdev/uuidv9-php","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"8256c7e4f2c992d3524867ddc486ecd56e2b9355"},"previous_names":["jhuntdev/uuidv9-php"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fuuidv9-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fuuidv9-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fuuidv9-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhuntdev%2Fuuidv9-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhuntdev","download_url":"https://codeload.github.com/jhuntdev/uuidv9-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246025942,"owners_count":20711576,"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":["php","uuid","v9"],"created_at":"2024-10-18T20:08:00.018Z","updated_at":"2025-03-28T11:45:55.501Z","avatar_url":"https://github.com/jhuntdev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UUID v9\n\n## Fast, lightweight, zero-dependency PHP implementation of UUID version 9\n\nThe v9 UUID supports both sequential (time-based) and non-sequential (random) UUIDs with an optional prefix of up to four bytes, an optional checksum, and sufficient randomness to avoid collisions. It uses the UNIX timestamp for sequential UUIDs and CRC-8 for checksums. A version digit can be added if desired, but is omitted by default.\n\nTo learn more about UUID v9, please visit the website: https://uuidv9.jhunt.dev\n\n## Installation\n\nInstall UUID v9 with Composer\n\n```bash\ncomposer require uuid-v9/uuid-v9\n```\n\n## Usage\n\n```php\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse UUIDv9\\UUIDv9\\UUIDv9;\n\n$orderedId = UUIDv9();\n$prefixedOrderedId = UUIDv9(['prefix' =\u003e 'a1b2c3d4']);\n$unorderedId = UUIDv9(['timestamp' =\u003e false]);\n$prefixedUnorderedId = UUIDv9(['prefix' =\u003e 'a1b2c3d4', 'timestamp' =\u003e false]);\n$orderedIdWithChecksum = UUIDv9(['checksum' =\u003e true]);\n$orderedIdWithVersion = UUIDv9(['version' =\u003e true]);\n$orderedIdWithLegacyMode = UUIDv9(['legacy' =\u003e true]);\n\n$isValid = IsValidUuidV9($orderedId);\n$isValidWithChecksum = IsValidUuidV9($orderedIdWithChecksum, ['checksum' =\u003e true]);\n$isValidWithVersion = IsValidUuidV9($orderedIdWithVersion, ['version' =\u003e true]);\n```\n\n## Backward Compatibility\n\nSome UUID validators check for specific features of v1 or v4 UUIDs. This causes some valid v9 UUIDs to appear invalid. Three possible workarounds are:\n\n1) Use the built-in validator (recommended)\n2) Use legacy mode*\n3) Bypass the validator (not recommended)\n\n_*Legacy mode adds version and variant digits to immitate v1 or v4 UUIDs depending on the presence of a timestamp._\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuntdev%2Fuuidv9-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhuntdev%2Fuuidv9-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhuntdev%2Fuuidv9-php/lists"}