{"id":27662542,"url":"https://github.com/nalgeon/uuidv7","last_synced_at":"2025-06-17T11:13:06.683Z","repository":{"id":244523498,"uuid":"815485699","full_name":"nalgeon/uuidv7","owner":"nalgeon","description":"UUIDv7 in N languages","archived":false,"fork":false,"pushed_at":"2025-03-21T17:14:26.000Z","size":61,"stargazers_count":95,"open_issues_count":0,"forks_count":27,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-12T12:54:33.287Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Racket","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nalgeon.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-06-15T09:53:43.000Z","updated_at":"2025-05-30T00:19:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d3445ce-71ee-4412-811f-c089394129ef","html_url":"https://github.com/nalgeon/uuidv7","commit_stats":null,"previous_names":["nalgeon/uuidv7"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nalgeon/uuidv7","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalgeon%2Fuuidv7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalgeon%2Fuuidv7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalgeon%2Fuuidv7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalgeon%2Fuuidv7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nalgeon","download_url":"https://codeload.github.com/nalgeon/uuidv7/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalgeon%2Fuuidv7/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260347083,"owners_count":22995161,"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":"2025-04-24T10:01:43.463Z","updated_at":"2025-06-17T11:13:01.675Z","avatar_url":"https://github.com/nalgeon.png","language":"Racket","funding_links":[],"categories":["Generation"],"sub_categories":["Polyglot"],"readme":"# UUIDv7 in N languages\n\nUUIDv7 is a 128-bit unique identifier like its older siblings, such as the widely used UUIDv4. But unlike v4, UUIDv7 is time-sortable with 1 ms precision. By combining the timestamp and the random parts, UUIDv7 becomes an excellent choice for record identifiers in databases, including distributed ones.\n\nThis repo provides zero-dependency UUIDv7 implementations in various languages. If you spot a bug — please submit a pull request. PRs for other languages are also welcome!\n\n## Structure\n\nUUIDv7 looks like this when represented as a string:\n\n```\n0190163d-8694-739b-aea5-966c26f8ad91\n└─timestamp─┘ │└─┤ │└───rand_b─────┘\n             ver │var\n              rand_a\n```\n\nThe 128-bit value consists of several parts:\n\n-   `timestamp` (48 bits) is a Unix timestamp in milliseconds.\n-   `ver` (4 bits) is a UUID version (`7`).\n-   `rand_a` (12 bits) is randomly generated.\n-   `var`\\* (2 bits) is equal to `10`.\n-   `rand_b` (62 bits) is randomly generated.\n\n\\* In string representation, each symbol encodes 4 bits as a hex number, so the `a` in the example is `1010`, where the first two bits are the fixed variant (`10`) and the next two are random. So the resulting hex number can be either `8` (`1000`), `9` (`1001`), `a` (`1010`) or `b` (`1011`).\n\nSee [RFC 9652](https://www.rfc-editor.org/rfc/rfc9562#name-uuid-version-7) for details.\n\n## Implementations\n\n[C](src/uuidv7.c) •\n[C#](src/uuidv7.cs) •\n[C++](src/uuidv7.cpp) •\n[Clojure](src/uuidv7.clj) •\n[Crystal](src/uuidv7.cr) •\n[Dart](src/uuidv7.dart) •\n[Emacs Lisp](src/uuidv7.el) •\n[Elixir](src/uuidv7.exs) •\n[Erlang](src/uuidv7.erl) •\n[F#](src/uuidv7.fsx) •\n[Gleam](src/uuidv7.gleam) •\n[Go](src/uuidv7.go) •\n[Inko](src/uuidv7.inko) •\n[Java](src/uuidv7.java) •\n[JavaScript](src/uuidv7.js) •\n[Julia](src/uuidv7.jl) •\n[Kotlin](src/uuidv7.kt) •\n[Lua](src/uuidv7.lua) •\n[Nim](src/uuidv7.nim) •\n[Nushell](src/uuidv7.nu) •\n[Perl](src/uuidv7.pl) •\n[PHP](src/uuidv7.php) •\n[Pascal](src/uuidv7.pas) •\n[PowerShell](src/uuidv7.ps1) •\n[Python](src/uuidv7.py) •\n[R](src/uuidv7.r) •\n[Racket](src/uuidv7.rkt) •\n[Ruby](src/uuidv7.rb) •\n[Rust](src/uuidv7.rs) •\n[Shell](src/uuidv7.sh) •\n[SQL](src/uuidv7.sql) •\n[SQL Server](src/uuidv7.tsql) •\n[Swift](src/uuidv7.swift) •\n[Tcl](src/uuidv7.tcl) •\n[V](src/uuidv7.v) •\n[Vimscript](src/uuidv7.vim) •\n[Zig](src/uuidv7.zig)\n\n## License\n\nThe Unlicense.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnalgeon%2Fuuidv7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnalgeon%2Fuuidv7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnalgeon%2Fuuidv7/lists"}