Our great sponsors
-
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.
-
vanity-uuid
Create "readable" UUIDs such as "5eedbed5-f05e-b055-ada0-d15ab11171e5" for all your UUID needs!
-
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.
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));
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
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
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.
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
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.)
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));
Use integer IDs and a library like Hashids for friendly alphanumeric representations: https://hashids.org/
This particular implementation is available in dozens of languages.
(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
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
Related posts
- Plan B for UUIDs: double AES-128
- Usando ULIDs para criar ordem em dados não ordenados
- [Discussion] This last week, for the first time in years, I managed to accomplish everything I set out to do
- Convert .tap file to .wav to record onto cassette.
- piece of software to find /crawl information about yourself?