{"id":13467570,"url":"https://github.com/jetify-com/typeid","last_synced_at":"2025-05-14T21:06:59.905Z","repository":{"id":173480766,"uuid":"650811309","full_name":"jetify-com/typeid","owner":"jetify-com","description":"Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs","archived":false,"fork":false,"pushed_at":"2025-04-02T20:18:28.000Z","size":99,"stargazers_count":3121,"open_issues_count":7,"forks_count":39,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-05-02T22:02:07.407Z","etag":null,"topics":["guid","typeid","uuid","uuidv7"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jetify-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-06-07T21:29:58.000Z","updated_at":"2025-04-28T17:51:35.000Z","dependencies_parsed_at":"2023-12-01T23:28:34.863Z","dependency_job_id":"db439607-5217-401d-bab3-0415c5a7b805","html_url":"https://github.com/jetify-com/typeid","commit_stats":{"total_commits":99,"total_committers":34,"mean_commits":2.911764705882353,"dds":0.7171717171717171,"last_synced_commit":"9129b051eb14c5553dbebc99119c7b4741e5219b"},"previous_names":["jetpack-io/typeid","jetify-com/typeid"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetify-com%2Ftypeid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetify-com%2Ftypeid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetify-com%2Ftypeid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetify-com%2Ftypeid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jetify-com","download_url":"https://codeload.github.com/jetify-com/typeid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254227612,"owners_count":22035669,"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":["guid","typeid","uuid","uuidv7"],"created_at":"2024-07-31T15:00:58.030Z","updated_at":"2025-05-14T21:06:54.889Z","avatar_url":"https://github.com/jetify-com.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# TypeID\n\n### A type-safe, K-sortable, globally unique identifier inspired by Stripe IDs\n\n![License: Apache 2.0](https://img.shields.io/github/license/jetify-com/typeid)\n[![Join Discord](https://img.shields.io/discord/903306922852245526?color=7389D8\u0026label=discord\u0026logo=discord\u0026logoColor=ffffff)](https://discord.gg/jetify)\n[![Built with Devbox](https://www.jetify.com/img/devbox/shield_galaxy.svg)](https://www.jetify.com/devbox/)\n\n## What is it?\n\nTypeIDs are a modern, type-safe extension of UUIDv7. Inspired by a similar use\nof prefixes in Stripe's APIs.\n\nTypeIDs are canonically encoded as lowercase strings consisting of three parts:\n\n1. A type prefix (at most 63 characters in all lowercase snake_case ASCII\n   [a-z_]).\n2. An underscore '\\_' separator\n3. A 128-bit UUIDv7 encoded as a 26-character string using a modified base32\n   encoding.\n\nHere's an example of a TypeID of type `user`:\n\n```\nuser_2x4y6z8a0b1c2d3e4f5g6h7j8k\n└──┘ └────────────────────────┘\ntype    uuid suffix (base32)\n```\n\nA [formal specification](./spec) defines the encoding in more detail.\n\n## Online Converter\n\nYou can try converting UUID to TypeID and back using Jetify's TypeID Converter.\nPaste your TypeID string to convert to UUID or put your prefix and UUID in this\nformat: `prefix:UUID` to convert to TypeID.\n\n### [jetify.com/typeid](https://www.jetify.com/typeid)\n\n## Benefits\n\n- **Type-safe:** you can't accidentally use a `user` ID where a `post` ID is\n  expected. When debugging, you can immediately understand what type of entity a\n  TypeID refers to thanks to the type prefix.\n- **Compatible with UUIDs:** TypeIDs are a superset of UUIDs. They are based on\n  the upcoming\n  [UUIDv7 standard](https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#name-uuid-version-7).\n  If you decode the TypeID and remove the type information, you get a valid\n  UUIDv7.\n- **K-Sortable**: TypeIDs are K-sortable and can be used as the primary key in a\n  database while ensuring good locality. Compare to entirely random global ids,\n  like UUIDv4, that generally suffer from poor database locality.\n- **Thoughtful encoding**: the base32 encoding is URL safe, case-insensitive,\n  avoids ambiguous characters, can be selected for copy-pasting by\n  double-clicking, and is a more compact encoding than the traditional hex\n  encoding used by UUIDs (26 characters vs 36 characters).\n\n## Implementations\n\nImplementations should adhere to the formal [specification](./spec).\n\nLatest spec version: v0.3.0\n\n### Official Implementations by `jetify`\n\n| Language                                              | Status        | Spec Version |\n| ----------------------------------------------------- | ------------- | ------------ |\n| [Go](https://github.com/jetify-com/typeid-go)         | ✓ Implemented | v0.3         |\n| [SQL](https://github.com/jetify-com/typeid-sql)       | ✓ Implemented | v0.2         |\n| [TypeScript](https://github.com/jetify-com/typeid-js) | ✓ Implemented | v0.3         |\n\n### Community Provided Implementations\n\n| Language                                                      | Author                                                                                    | Spec Version                                                                                                        |\n| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| [C# (.Net)](https://github.com/TenCoKaciStromy/typeid-dotnet) | [@TenCoKaciStromy](https://github.com/TenCoKaciStromy)                                    | v0.2 on 2023-06-30                                                                                                  |\n| [C# (.Net Standard 2.1)](https://github.com/cbuctok/typeId)   | [@cbuctok](https://github.com/cbuctok)                                                    | v0.2 on 2023-07-03                                                                                                  |\n| [C# (.NET)](https://github.com/firenero/TypeId)               | [@firenero](https://github.com/firenero)                                                  | v0.3 on 2024-04-15                                                                                                  |\n| [Dart](https://github.com/TBD54566975/typeid-dart)            | [@mistermoe](https://github.com/mistermoe) [@tbd54566975](https://github.com/tbd54566975) | [v0.3 on 2024-07-02](https://github.com/TBD54566975/typeid-dart/actions/runs/9755701869/job/26924658060#step:6:10)  |\n| [Elixir](https://github.com/sloanelybutsurely/typeid-elixir)  | [@sloanelybutsurely](https://github.com/sloanelybutsurely)                                | v0.3 on 2024-04-22                                                                                                  |\n| [Elixir](https://github.com/xinz/elixir_typeid)               | [@xinz](https://github.com/xinz)                                                          | v0.1 on 2024-06-03                                                                                                  |\n| [Erlang](https://github.com/eproxus/keysmith)                 | [@eproxus](https://github.com/eproxus)                                                    | v0.3 on 2024-09-25                                                                                                  |\n| [Haskell](https://github.com/MMZK1526/mmzk-typeid)            | [@MMZK1526](https://github.com/MMZK1526)                                                  | v0.3 on 2024-04-19                                                                                                  |\n| [Java](https://github.com/fxlae/typeid-java)                  | [@fxlae](https://github.com/fxlae)                                                        | v0.3 on 2024-04-14                                                                                                  |\n| [Java](https://github.com/softprops/typeid-java)              | [@softprops](https://github.com/softprops)                                                | v0.2 on 2023-07-04                                                                                                  |\n| [Kotlin](https://github.com/aleris/typeid-kotlin)             | [@aleris](https://github.com/aleris)                                                      | v0.3 on 2024-05-18                                                                                                  |\n| [OCaml](https://github.com/titouancreach/typeid-ocaml)        | [@titouancreach](https://github.com/titouancreach)                                        | v0.3 on 2024-04-22                                                                                                  |\n| [PHP](https://github.com/basecodeoy/typeid)                   | [@BaseCodeOy](https://github.com/basecodeoy)                                              | v0.3 on 2024-12-06                                                                                                  |\n| [Postgres](https://github.com/blitss/typeid-postgres)         | [@blitss](https://github.com/blitss)                                                      | [v0.3 on 2024-06-24](https://github.com/blitss/typeid-postgres/actions/runs/9637303320/job/26576304134#step:11:288) |\n| [Python](https://github.com/akhundMurad/typeid-python)        | [@akhundMurad](https://github.com/akhundMurad)                                            | [v0.3 on 2024-04-19](https://github.com/akhundMurad/typeid-python/releases/tag/v0.3.0)                              |\n| [Ruby](https://github.com/broothie/typeid-ruby)               | [@broothie](https://github.com/broothie)                                                  | [v0.3 on 2024-04-13](https://github.com/broothie/typeid-ruby/pull/17)                                               |\n| [Rust](https://github.com/conradludgate/type-safe-id)         | [@conradludgate](https://github.com/conradludgate)                                        | [v0.3 on 2024-04-12](https://github.com/conradludgate/type-safe-id/pull/1)                                          |\n| [Rust](https://github.com/johnnynotsolucky/strong_id)         | [@johnnynotsolucky](https://github.com/johnnynotsolucky)                                  | [v0.3 on 2024-05-17](https://github.com/johnnynotsolucky/strong_id/commit/10aa50487bbdd851c58a2ed73071a50452441370) |\n| [Rust](https://github.com/Govcraft/mti)                       | [@Govcraft](https://github.com/Govcraft)                                                  | [v0.3 on 2024-07-15](https://github.com/Govcraft/mti/actions/runs/9945923733)                                       |\n| [Scala](https://github.com/ant8e/uuid4cats-effect)            | [@ant8e](https://github.com/ant8e)                                                        | v0.3 on 2024-04-19                                                                                                  |\n| [Scala](https://github.com/guizmaii-opensource/zio-uuid)      | [@guizmaii](https://github.com/guizmaii)                                                  | Not validated yet                                                                                                   |\n| [Swift](https://github.com/Frizlab/swift-typeid)              | [@Frizlab](https://github.com/Frizlab)                                                    | v0.3 on 2024-04-19                                                                                                  |\n| [T-SQL](https://github.com/uniteeio/typeid_tsql)              | [@uniteeio](https://github.com/uniteeio)                                                  | v0.2 on 2023-08-25                                                                                                  |\n| [TypeScript](https://github.com/ongteckwu/typeid-ts)          | [@ongteckwu](https://github.com/ongteckwu)                                                | v0.2 on 2023-06-30                                                                                                  |\n| [Zig](https://github.com/nikoksr/typeid-zig)                  | [@nikoksr](https://github.com/nikoksr)                                                    | v0.3 on 2024-12-29                                                                                                  |\n\nWe are looking for community contributions to implement TypeIDs in other\nlanguages.\n\n## Command-line Tool\n\nThis repo includes a command-line tool for generating TypeIDs. To install it,\nrun:\n\n```bash\ncurl -fsSL https://get.jetify.com/typeid | bash\n```\n\nTo generate a new TypeID, run:\n\n```console\n$ typeid new prefix\nprefix_01h2xcejqtf2nbrexx3vqjhp41\n```\n\nTo decode an existing TypeID into a UUID run:\n\n```console\n$ typeid decode prefix_01h2xcejqtf2nbrexx3vqjhp41\ntype: prefix\nuuid: 0188bac7-4afa-78aa-bc3b-bd1eef28d881\n```\n\nAnd to encode an existing UUID into a TypeID run:\n\n```console\n$ typeid encode prefix 0188bac7-4afa-78aa-bc3b-bd1eef28d881\nprefix_01h2xcejqtf2nbrexx3vqjhp41\n```\n\n## Related Work\n\n- [UUIDv7](https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#name-uuid-version-7) -\n  The upcoming UUID standard that TypeIDs are based on.\n\nAlternatives to UUIDv7 that are also worth considering (but not type-safe like\nTypeIDs):\n\n- [xid](https://github.com/rs/xid)\n- [ulid](https://github.com/ulid)\n- [ksuid](https://github.com/segmentio/ksuid)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetify-com%2Ftypeid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjetify-com%2Ftypeid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetify-com%2Ftypeid/lists"}