{"id":19036187,"url":"https://github.com/tx7do/go-uuid-examples","last_synced_at":"2026-05-05T21:30:15.697Z","repository":{"id":112433643,"uuid":"478904484","full_name":"tx7do/go-uuid-examples","owner":"tx7do","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-07T15:22:23.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T05:32:20.028Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tx7do.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":"2022-04-07T08:58:07.000Z","updated_at":"2022-04-07T13:42:13.000Z","dependencies_parsed_at":"2023-05-15T02:45:09.945Z","dependency_job_id":null,"html_url":"https://github.com/tx7do/go-uuid-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx7do%2Fgo-uuid-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx7do%2Fgo-uuid-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx7do%2Fgo-uuid-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx7do%2Fgo-uuid-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tx7do","download_url":"https://codeload.github.com/tx7do/go-uuid-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240093142,"owners_count":19746774,"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":[],"created_at":"2024-11-08T21:53:40.964Z","updated_at":"2026-05-05T21:30:15.497Z","avatar_url":"https://github.com/tx7do.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-uuid-examples\r\n\r\n| 软件包                                                            | 样例                                     | 格式                                                                                 |\r\n|----------------------------------------------------------------|----------------------------------------|------------------------------------------------------------------------------------|\r\n| [ksuid](github.com/segmentio/ksuid)                            | 0pPKHjWprnVxGH7dEsAoXX2YQvU\t           | 4 bytes of time (seconds) + 16 random bytes                                        |\r\n| [xid](github.com/rs/xid)                                       | b50vl5e54p1000fo3gh0                   | 4 bytes of time (seconds) + 3 byte machine id + 2 byte process id + 3 bytes random |\r\n| [betterguid](github.com/kjk/betterguid)                        | -N-35bz_wVbhxzTZD2wO                   | 8 bytes of time (milliseconds) + 9 random bytes                                    |\r\n| [sonyflake](github.com/sony/sonyflake)                         | 402329004549341446                     | ~6 bytes of time (10 ms) + 1 byte sequence + 2 bytes machine id                    |\r\n| [snowflake](github.com/bwmarrin/snowflake)                     | 1512052461246971904                    | 1 Bit Unused + 41 Bit Timestamp + 10 Bit NodeID + 12 Bit Sequence ID               |\r\n| [snowflake](github.com/godruoyi/go-snowflake)                  | 1512052461246971904                    | 1 Bit Unused + 41 Bit Timestamp + 10 Bit NodeID + 12 Bit Sequence ID               |\r\n| [ulid](github.com/oklog/ulid)                                  | 01BJMVNPBBZC3E36FJTGVF0C4S\t            | 6 bytes of time (milliseconds) + 8 bytes random                                    |\r\n| [sid](github.com/chilts/sid)                                   | 1JADkqpWxPx-4qaWY47~FqI\t               | 8 bytes of time (ns) + 8 random bytes                                              |\r\n| [shortuuid](https://github.com/lithammer/shortuuid)            | dwRQAc68PhHQh4BUnrNsoS\t                | UUIDv4 or v5, encoded in a more compact way                                        |\r\n| [go.uuid](github.com/satori/go.uuid)                           | 5b52d72c-82b3-4f8e-beb5-437a974842c\t   | UUIDv4 from RFC 4112 for comparison                                                |\r\n| [google.uuid](https://github.com/google/uuid)                  | dd5f48eb-1722-4e5f-9d56-dcaf0aae1026\t\t | UUIDv4                                                                             |\r\n| [bomberman.uuid](https://github.com/pborman/uuid)              | 330806cf-684c-43f7-85aa-79939ed3415d\t\t | UUIDv4                                                                             |\r\n| [MongoDB ObjectID](go.mongodb.org/mongo-driver/bson/primitive) | 624ee0fb37583f00042dc309\t\t             | 4-byte timestamp + 5-byte random value + 3-byte incrementing counter               |\r\n\r\n## 参考资料\r\n\r\n* [Generating good unique ids in Go](https://blog.kowalczyk.info/article/JyRZ/generating-good-unique-ids-in-go.html)\r\n* [Generate a UUID/GUID in Go (Golang)](https://golangbyexample.com/generate-uuid-guid-golang/)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftx7do%2Fgo-uuid-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftx7do%2Fgo-uuid-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftx7do%2Fgo-uuid-examples/lists"}