{"id":24702549,"url":"https://github.com/yankeguo/snowid","last_synced_at":"2026-01-11T04:03:41.010Z","repository":{"id":59046895,"uuid":"533556011","full_name":"yankeguo/snowid","owner":"yankeguo","description":"A concurrent-safe lock-free implementation of snowflake algorithm in Golang","archived":false,"fork":false,"pushed_at":"2024-09-27T09:00:03.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T19:21:13.464Z","etag":null,"topics":["algorithm","golang","id-generation"],"latest_commit_sha":null,"homepage":"","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/yankeguo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"yankeguo","patreon":"yankeguo"}},"created_at":"2022-09-07T01:16:48.000Z","updated_at":"2024-09-27T09:00:06.000Z","dependencies_parsed_at":"2025-01-27T05:41:43.562Z","dependency_job_id":"596e4b27-d8d0-4ad9-b69d-070380fcbb3c","html_url":"https://github.com/yankeguo/snowid","commit_stats":null,"previous_names":["yankeguo/snowid","guoyk93/snowid"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/yankeguo/snowid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankeguo%2Fsnowid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankeguo%2Fsnowid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankeguo%2Fsnowid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankeguo%2Fsnowid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yankeguo","download_url":"https://codeload.github.com/yankeguo/snowid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankeguo%2Fsnowid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28280345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T03:48:11.750Z","status":"ssl_error","status_checked_at":"2026-01-11T03:48:02.765Z","response_time":60,"last_error":"SSL_read: 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":["algorithm","golang","id-generation"],"created_at":"2025-01-27T05:41:37.826Z","updated_at":"2026-01-11T04:03:40.993Z","avatar_url":"https://github.com/yankeguo.png","language":"Go","funding_links":["https://github.com/sponsors/yankeguo","https://patreon.com/yankeguo"],"categories":[],"sub_categories":[],"readme":"# snowid\n\n[![workflow badge](https://github.com/yankeguo/snowid/actions/workflows/go.yml/badge.svg)](https://github.com/yankeguo/snowid/actions)\n[![Go Reference](https://pkg.go.dev/badge/github.com/yankeguo/snowid.svg)](https://pkg.go.dev/github.com/yankeguo/snowid)\n[![codecov](https://codecov.io/gh/yankeguo/snowid/graph/badge.svg?token=MAMV3GWQ8R)](https://codecov.io/gh/yankeguo/snowid)\n\nA concurrent-safe lock-free implementation of snowflake algorithm in Golang\n\n## Install\n\n`go get -u github.com/yankeguo/snowid`\n\n## Usage\n\n```go\n// create an unique identifier\nid, _ := strconv.ParseUint(os.Getenv(\"WORKER_ID\"), 10, 64)\n\n// create an instance (a sonyflake like instance)\ns := snowid.New(snowflake.Options{\n    Epoch: time.Date(2020, time.January, 1, 0, 0, 0, 0, time.UTC),\n    ID: id,\n    Grain: time.Millisecond*10,\n    LeadingBit: true,\n})\n\n// get a id\ns.NewID()\n\n// stop and release all related resource\ns.Stop()\n\n```\n\n## Performance\n\nLess than `1us/op` on **Apple MacBook Air (M1)**\n\n```\ngoos: darwin\ngoarch: arm64\npkg: github.com/yankeguo/snowid\nBenchmarkGenerator_NewID-8       2465515               469.5 ns/op\nPASS\nok      github.com/yankeguo/snowid       1.742s\n```\n\n## Credits\n\nGUO YANKE, MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyankeguo%2Fsnowid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyankeguo%2Fsnowid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyankeguo%2Fsnowid/lists"}