New UUID Formats from IETF

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • prototypes

    Draft Prototypes and Tests for UUIDv6 and beyond

  • I made a simple Python test library that extends the standard UUID class with UUIDv6 and UUIDv7. You might want to check it out. https://github.com/oittaa/uuid6-python

    The official UUID Draft repository has also some alternatives if you'd like to check those out. https://github.com/uuid6/prototypes

    Postgres supports UUIDs with any version number natively so you can then do something like this with it:

      create table data (id uuid, firstname varchar(100));

  • ulid

    Universally Unique Lexicographically Sortable Identifier (ULID) in Python 3 (by ahawker)

  • As the author of a popular ULID implementation in python[1], the spec has no stewardship anymore. The specification repo[2] has plenty of open issues and no real guidance or communication beyond language implementation authors discussing corner cases. The monotonic functionality is ambiguous (at best) and is implemented differently per-languages [3].

    Functionality, UUIDv7 might be the _same_ but the hope would be for a more rigid specification for interoperability.

    [1]: https://github.com/ahawker/ulid

    [2]: https://github.com/ulid/spec

    [3]: https://github.com/ulid/spec/issues/11

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • spec

    The canonical spec for ulid

  • As the author of a popular ULID implementation in python[1], the spec has no stewardship anymore. The specification repo[2] has plenty of open issues and no real guidance or communication beyond language implementation authors discussing corner cases. The monotonic functionality is ambiguous (at best) and is implemented differently per-languages [3].

    Functionality, UUIDv7 might be the _same_ but the hope would be for a more rigid specification for interoperability.

    [1]: https://github.com/ahawker/ulid

    [2]: https://github.com/ulid/spec

    [3]: https://github.com/ulid/spec/issues/11

  • uuid

    Generate and parse UUIDs. (by uuid-rs)

  • Those aren’t bytes — they’re integers of various sizes. (Hint: do not use integer types in C code for portable data structures. ntohl, etc are a mess. Just use arrays of bytes.)

    I don’t know the whole history, but MS somehow took this structure at face value and caused problems like this:

    https://github.com/uuid-rs/uuid/issues/277

    So, if you want to do anything (e.g. sorting) that depends on the representation of a UUID (or even depends on converting between string and binary representations), be aware that UUIDs coming from Windows may be little-endian. In my book, this is a Windows bug, but opinions may differ here.

  • vanity-uuid

    Create "readable" UUIDs such as "5eedbed5-f05e-b055-ada0-d15ab11171e5" for all your UUID needs!

  • With the introduction of UUIDv8, my fun script to generate vanity uuids[0] can finally be spec comfortant!

    [0]:https://github.com/operator-name/vanity-uuid

  • presents

    Like hashids, but based on block ciphers

  • I’ve been working on a robust scheme for encrypted sequential IDs, which is done, including implementations in Rust, JavaScript and Python, pending just a smidgeon more writing about it and reviewing a decision on naming. You store an integer in the database, then encrypt it with a real block cipher, and stringify with Base58. I have three modes: one for 32-bit IDs, using Speck32/64 and producing 4–6 character IDs; one for 64-bit IDs, using Speck64/128 and producing 8–11 character IDs; and one hybrid, using the 32-bit mode for IDs below 2³² and the 64-bit mode above that, providing both a forwards-compatibility measure and a way of producing short IDs as long as possible. Contact me (see my profile) if you’re interested, or I’ll probably publish it in another day or two. Trouble is that I’ve been getting distracted with other related concepts, like optimally-short encoding by using encryption domains [0, 58¹), [58¹, 58²), …, [58¹⁰, 2⁶⁴) (this is format-preserving encryption; the main reputable and practical choices I’ve found are Hasty Pudding, which I’ve just about finished implementing but would like test vectors for but they’re on a dead FTP site, and NIST’s FF1 and FF3, which are patent-encumbered), and ways of avoiding undesirable patterns (curse words and such) by skipping integers from the database’s ID sequence if they encode to what you don’t want, and check characters with the Damm algorithm. If I didn’t keep getting distracted with these things, I’d have published a couple of weeks ago.

    (I am not aware of any open-source library embodying a scheme like what I propose—all that I’ve found have either reduced scope or badly broken encryption; https://github.com/yi-jiayu/presents is sound, but doesn’t stringify; Hashids is broken almost beyond belief and should not be considered encryption; Optimus uses an extremely weak encryption.)

  • uuid6-python

    New time-based UUID formats which are suited for use as a database key

  • I made a simple Python test library that extends the standard UUID class with UUIDv6 and UUIDv7. You might want to check it out. https://github.com/oittaa/uuid6-python

    The official UUID Draft repository has also some alternatives if you'd like to check those out. https://github.com/uuid6/prototypes

    Postgres supports UUIDs with any version number natively so you can then do something like this with it:

      create table data (id uuid, firstname varchar(100));

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Hashids.java

    Hashids algorithm v1.0.0 implementation in Java

  • Use integer IDs and a library like Hashids for friendly alphanumeric representations: https://hashids.org/

    This particular implementation is available in dozens of languages.

  • brain

    Swyx's second brain! (by swyxio)

  • (poster here)

    these formats are not new new, but are still pretty new.

    the context is i keep a list of uuid impls and knowledge for my own reference. posted this up today simply because I got a PR from some subscribers https://github.com/sw-yx/brain/pull/36

  • dart-uuid

    Generate RFC4122(v1,v4,v5,v6,v7,v8) UUIDs

  • I maintain the Dart UUID library. For anyone using dart, or wants to see one of many implementations of v6,v7 and a custom v8 UUID, feel free to look at my in-progress branch linked below, I plan to merge it in once they add different string representations in a future draft (I've been involved in the conversations).

    https://github.com/Daegalus/dart-uuid/tree/uuidv6

  • uuid7

    UUID version 7, which are time-sortable (following the Peabody RFC4122 draft)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts