{"id":22859842,"url":"https://github.com/ashwingopalsamy/uuidcheck","last_synced_at":"2025-05-07T09:09:40.129Z","repository":{"id":266865946,"uuid":"899501358","full_name":"ashwingopalsamy/uuidcheck","owner":"ashwingopalsamy","description":"A tiny, zero-dependency Go library that validates UUIDs against standard RFC 4122 formatting, converts UUIDv7() into timestamps by ensuring accuracy and light compute.","archived":false,"fork":false,"pushed_at":"2024-12-08T04:28:39.000Z","size":22,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T09:09:34.677Z","etag":null,"topics":["go","good-first-issue","good-first-project","open-source","timestamp","uuid"],"latest_commit_sha":null,"homepage":"https://github.com/ashwingopalsamy/uuidcheck","language":"Go","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/ashwingopalsamy.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-12-06T11:55:02.000Z","updated_at":"2024-12-30T07:30:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"33bf7ef9-4c80-4b99-bd3c-0ff3cc78fa94","html_url":"https://github.com/ashwingopalsamy/uuidcheck","commit_stats":null,"previous_names":["ashwingopalsamy/uuidcheck"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwingopalsamy%2Fuuidcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwingopalsamy%2Fuuidcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwingopalsamy%2Fuuidcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwingopalsamy%2Fuuidcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashwingopalsamy","download_url":"https://codeload.github.com/ashwingopalsamy/uuidcheck/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252847499,"owners_count":21813455,"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":["go","good-first-issue","good-first-project","open-source","timestamp","uuid"],"created_at":"2024-12-13T09:08:12.073Z","updated_at":"2025-05-07T09:09:40.111Z","avatar_url":"https://github.com/ashwingopalsamy.png","language":"Go","funding_links":[],"categories":["UUID"],"sub_categories":["Utility/Miscellaneous","实用程序/Miscellaneous"],"readme":"# uuidcheck\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/ashwingopalsamy/uuidcheck.svg)](https://pkg.go.dev/github.com/ashwingopalsamy/uuidcheck)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go) \n[![Go Report Card](https://goreportcard.com/badge/github.com/ashwingopalsamy/uuidcheck)](https://goreportcard.com/report/github.com/ashwingopalsamy/uuidcheck)\n[![Coverage Status](https://codecov.io/gh/ashwingopalsamy/uuidcheck/branch/master/graph/badge.svg)](https://codecov.io/gh/ashwingopalsamy/uuidcheck)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n\nA tiny, zero-dependency Go library that validates UUIDs against standard RFC 4122 formatting, converts UUIDv7() into timestamps by ensuring accuracy and light compute.\n\n**Why?**\nSometimes you just need to know if that string is a proper UUID without dragging in heavy libraries or writing clunky checks. `uuidcheck` does one thing and does it well.\n\n## Features\n\n- **Simple \u0026 Light:** No regular expressions, no external dependencies and a single-pass check.\n- **Strict RFC 4122 Format:** Ensures correct length, hyphen positions and valid hex characters.\n- **UUIDv7 Support:** Extracts embedded timestamps from version 7 UUIDs.\n- **Fully Tested:** Includes comprehensive unit tests, covering a range of edge cases.\n\n## Getting Started\n\n```bash\ngo get github.com/ashwingopalsamy/uuidcheck\n```\n\n## How It Works\n\n`IsValidUUID` runs a quick series of checks:\n\n- **Length Check:** Must be exactly 36 characters.\n- **Hyphen Positions:** Hyphens must appear at positions 8, 13, 18, and 23.\n- **Hex Digits:** All other characters must be valid hex (`0-9`, `A-F`, `a-f`).\n\n`IsUUIDv7` checks the version nibble of the `time_hi_and_version` field, ensuring its '7'.\n\n`UUIDv7ToTimestamp` extracts the first 48 bits from the UUID (the combination of `time_low` and part of `time_mid`) and interprets them as a Unix timestamp in milliseconds.\n\n## Examples\n\n**Valid:**\n\n- `01939c00-282d-782f-9cc2-887dc7b40629`\n- `01939C00-282D-782F-9CC2-887DC7B40629`\n\n**Invalid:**\n\n- `01939c-282d-782f-9cc2-887` (too short)\n- `f01939c00-282d-782f-9cg2-887dc7b40629` (invalid hex char `g`)\n- `01939c00282d782f9cc2887dc7b40629` (no hyphens)\n\n## Testing\n\nWe believe in solid test coverage. Just run:\n\n```bash\ngo test -v ./...\n```\n\nYou'll find unit tests and edge case scenarios in `uuidcheck_test.go`.\n\n## Contributing\n\nContributions are welcome!\nFeel free to open issues, submit PRs, or propose features. Just keep it simple and aligned with the library’s goal: blazing-fast, straightforward UUID validation.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashwingopalsamy%2Fuuidcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashwingopalsamy%2Fuuidcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashwingopalsamy%2Fuuidcheck/lists"}