{"id":43045416,"url":"https://github.com/as/uuid","last_synced_at":"2026-01-31T09:46:32.899Z","repository":{"id":57496456,"uuid":"158378670","full_name":"as/uuid","owner":"as","description":"A fast uuid-v4 generator that never returns errors, panics, or runs out of entropy","archived":false,"fork":false,"pushed_at":"2023-05-18T18:12:58.000Z","size":14,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-14T03:47:45.583Z","etag":null,"topics":["crash","error","go","golang","panic","uuid","v4"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/as.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":"2018-11-20T11:26:17.000Z","updated_at":"2025-03-21T12:21:20.000Z","dependencies_parsed_at":"2024-06-20T12:01:44.383Z","dependency_job_id":"e90cd140-2e2b-4b89-b626-32f62d31c28b","html_url":"https://github.com/as/uuid","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/as/uuid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as%2Fuuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as%2Fuuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as%2Fuuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as%2Fuuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/as","download_url":"https://codeload.github.com/as/uuid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as%2Fuuid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28937578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T08:53:31.997Z","status":"ssl_error","status_checked_at":"2026-01-31T08:51:38.521Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["crash","error","go","golang","panic","uuid","v4"],"created_at":"2026-01-31T09:46:30.905Z","updated_at":"2026-01-31T09:46:32.885Z","avatar_url":"https://github.com/as.png","language":"Go","readme":"# uuid\nsimple uuid v4 generator without vacuous error returns\n\n# usage\n\n```\npackage main\n\nimport \"github.com/as/uuid\"\n\nfunc main() {\n\tfmt.Println(uuid.V4())\n}\n```\n\n# install\n\n`go get github.com/as/uuid`\n\n\n# questions\n\n- Do I have to check for errors?\n\u003e no\n\n- Does this panic when the entropy pool \"depletes\"?\n\u003e no\n\n- How does it work? Does it use `math/random`?\n\u003e it uses the AES family of ciphers as a CSPRNG \n\n- Is it faster than uuid package `X`?\n\u003e see benchmarks\n```\ngoos: linux\ngoarch: amd64\npkg: github.com/as/uuid\nBenchmarkV4-4           \t10000000\t       112 ns/op\nBenchmarkV4Parallel/X2/A-4       \t20000000\t       109 ns/op\nBenchmarkV4Parallel/X2/B-4       \t20000000\t       109 ns/op\nBenchmarkV4Parallel/X5/A-4       \t20000000\t       113 ns/op\nBenchmarkV4Parallel/X5/B-4       \t20000000\t       109 ns/op\nBenchmarkV4Parallel/X5/C-4       \t20000000\t       109 ns/op\nBenchmarkV4Parallel/X5/D-4       \t20000000\t       110 ns/op\nBenchmarkV4Parallel/X5/E-4       \t20000000\t       109 ns/op\nPASS\nok  \tgithub.com/as/uuid\t22.638s\n```\n\n- Will this generate a bunch of zeroes like some other `uuid` packages?\n\u003e read the tests\n\n```\ngo test -list .\nTestV4\nTestRace\nTestProbabilityDistribution\n```\n\n- Does it read from a file descriptor?\n\u003e It reads from your system's entropy source once, at initialization time.\n\n- Are there any conditions under which this will panic\n\u003e If the initial `crypto/rand` `Reader` can't read `\u003c100` random bytes. This happens once at init time.\n\n- What about the gofrs package?\n\u003e That package just makes you check for an error and still reads from /dev/random. This package actually solves the problem at the root.\n\n- How exactly does it work?\n\u003e It initializes an AES block cipher with a random key and random initialization vector. It uses the output of CryptBlocks to build the uuid and then runs the operation again to generate the next random UUID. The output will never repeat, even if the process is restarted.\n\n- I don't trust AES. What if the hard-core predicate of AES doesn't hold?\n\u003e You have bigger things to worry about. Also, most UUID implementations do not require a true random number generator. Especially if your database has a unique constraint, as such an error is much better than a panic in a production service.\n\n- Has this been used in production services?\n\u003e This package has been in use in at least 10 production services recieving a moderate volume of traffic. It has never emitted an error on the database side.\n\n- License\n\u003eBSD\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fas%2Fuuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fas%2Fuuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fas%2Fuuid/lists"}