{"id":34639903,"url":"https://github.com/projectsaturnstudios/quickuuid","last_synced_at":"2026-01-20T16:53:19.806Z","repository":{"id":302457996,"uuid":"1012501550","full_name":"projectsaturnstudios/quickuuid","owner":"projectsaturnstudios","description":"Simple helper functions to easily generate UUIDs (v4 and v5).","archived":false,"fork":false,"pushed_at":"2025-07-02T12:36:19.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-09T13:05:44.926Z","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/projectsaturnstudios.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2025-07-02T12:33:54.000Z","updated_at":"2025-07-02T12:36:07.000Z","dependencies_parsed_at":"2025-07-02T14:06:57.321Z","dependency_job_id":"d42a4fcd-280b-4487-a708-0b39734d9028","html_url":"https://github.com/projectsaturnstudios/quickuuid","commit_stats":null,"previous_names":["projectsaturnstudios/quickuuid"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/projectsaturnstudios/quickuuid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Fquickuuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Fquickuuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Fquickuuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Fquickuuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectsaturnstudios","download_url":"https://codeload.github.com/projectsaturnstudios/quickuuid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectsaturnstudios%2Fquickuuid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28005414,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-12-24T17:15:44.495Z","updated_at":"2025-12-24T17:15:47.440Z","avatar_url":"https://github.com/projectsaturnstudios.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProjectSaturnStudios/QuickUUID\n\nA simple PHP library providing helper functions to easily generate version 4 (random) and version 5 (name-based, SHA-1) UUIDs. It leverages the robust `ramsey/uuid` package under the hood.\n\n## Features\n\n- Generate UUIDv4.\n- Generate UUIDv5 with a specified name and an optional namespace.\n- A primary helper `new_uuid()` that intelligently calls either v4 or v5 generation based on provided arguments.\n- Configurable default namespace for UUIDv5 generation.\n\n## Installation\n\nInstall the package via Composer:\n\n```bash\ncomposer require projectsaturnstudios/quickuuid\n```\n\n## Basic Usage\n\n```php\n\u003c?php\n\nrequire_once 'vendor/autoload.php'; // Not needed if used within a framework like Laravel that handles autoloading\n\n// Generate a UUIDv4\n$uuid4 = new_uuid4();\necho \"UUIDv4: $uuid4\\n\";\n\n// --- UUIDv5 Generation ---\n\n// Define a name for your UUIDv5\n$name = 'com.example.myapp.someidentifier';\n\n// Generate a UUIDv5 using the default namespace\n// The default namespace is `Ramsey\\Uuid\\Uuid::NAMESPACE_DNS` unless you define\n// the `QUICKUUID_DEFAULT_V5_NAMESPACE` constant before this helper file is loaded.\n$uuid5_default_ns = new_uuid5($name);\necho \"UUIDv5 (default NS): $uuid5_default_ns\\n\";\n\n// Generate a UUIDv5 with a custom namespace\n$customNamespace = 'a1b2c3d4-e5f6-7788-9900-aabbccddeeff'; // Replace with your actual valid UUID namespace\nif (Ramsey\\Uuid\\Uuid::isValid($customNamespace)) {\n    $uuid5_custom_ns = new_uuid5($name, $customNamespace);\n    echo \"UUIDv5 (custom NS - '{$customNamespace}'): $uuid5_custom_ns\\n\";\n} else {\n    echo \"Custom namespace '{$customNamespace}' is not a valid UUID.\\n\";\n}\n\n// --- General Purpose new_uuid() Helper ---\n\n// No name provided, so it generates a UUIDv4\n$another_uuid4 = new_uuid(); \necho \"Another UUIDv4: $another_uuid4\\n\";\n\n// Name provided, so it generates a UUIDv5 with the default namespace\n$another_uuid5_default_ns = new_uuid($name);\necho \"Another UUIDv5 (default NS): $another_uuid5_default_ns\\n\";\n\n// Name and custom namespace provided for UUIDv5 generation\nif (Ramsey\\Uuid\\Uuid::isValid($customNamespace)) {\n    $another_uuid5_custom_ns = new_uuid($name, $customNamespace); \necho \"Another UUIDv5 (custom NS - '{$customNamespace}'): $another_uuid5_custom_ns\\n\";\n}\n\n?\u003e\n```\n\n### UUIDv5 Namespace Configuration\n\nThe `new_uuid5()` and `new_uuid()` (when generating a v5 UUID) functions use a default namespace. This default is `Ramsey\\Uuid\\Uuid::NAMESPACE_DNS`.\n\nYou can change this application-wide default by defining the `QUICKUUID_DEFAULT_V5_NAMESPACE` constant *before* the `quickuuid/src/Helpers/helpers.php` file is loaded by Composer. Make sure the value you define is a valid UUID string.\n\nExample (e.g., in your `bootstrap/app.php` or an early Composer autoloaded file):\n\n```php\nif (!defined('QUICKUUID_DEFAULT_V5_NAMESPACE')) {\n    define('QUICKUUID_DEFAULT_V5_NAMESPACE', 'YOUR-OWN-DEFAULT-NAMESPACE-UUID'); // Replace with your actual UUID\n}\n\n// Composer will then load quickuuid's helpers, which will use this constant.\n```\n\n## Dependencies\n\n- PHP ^8.2\n- `ramsey/uuid`: ^4.7\n\n## Running Quality Assurance\n\nThis package uses PHPUnit for tests and PHPStan for static analysis.\n\nTo run tests:\n```bash\ncomposer test\n```\n\nTo run static analysis:\n```bash\ncomposer analyse\n```\n\n## License\n\nThis package is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request or open an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectsaturnstudios%2Fquickuuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectsaturnstudios%2Fquickuuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectsaturnstudios%2Fquickuuid/lists"}