{"repo":"carderne/upid","free":true,"listed":false,"github":"https://github.com/carderne/upid","clone":"git clone https://github.com/carderne/upid.git","description":"Unique IDs with a built-in prefix","language":"Rust","stars":71,"topics":["database","id","uuid"],"license":"MIT","category":"databases-storage","readme_excerpt":"UPID pronounced YOO-pid aka Universally Unique Prefixed Lexicographically Sortable Identifier This is the spec and Python and Rust implementations for UPID. The Typescript implementation is here. UPID is based on ULID but with some modifications, inspired by this article and Stripe IDs. The core idea is that a meaningful prefix is specified that is stored in a 128-bit UUID-shaped slot. Thus a UPID is human-readable (like a Stripe ID), but still efficient to store, sort and index. UPID allows a prefix of up to 4 characters (will be right-padded if shorter than 4), includes a non-wrapping timestamp with about 250 millisecond precision, and 64 bits of entropy. This is a UPID in Python: And in Rust: And in Postgres too: Plays nice with your server code, no extra work needed: Examples You can try out the Python and Rust examples in this repository. They both involve spinning up a Postgres DB and inserting a UPID as itself, as a UUID and as text. - ./examples/python - ./examples/rust There are also TypeScript examples for browser and Node (with Postgres) in the upid-ts repo. Demo You can give it a spin at upid.rdrn.me. Benefits - Context : You'll never forget what kind of ID you're staring at. Is it a user or a prod or maybe a role ? Your product team will thank you, as will your API users. - Compatible : Under the hood it's just 128 bits, so you can pass it to Postgres or anything else and pretend it's a UUID. But you'll know your prefix is safely waiting to remind you what it is.","default_branch":null,"files":null,"tree":[],"storefront":"/r/carderne","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/carderne/upid/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}