This had appeared a few times before at earlier stages of the draft process... https://news.ycombinator.com/item?id=28088213 [244 comments] Personally, I really like UUIDv7, except I transform the UUID to a 25-character string which has all the same properties except it doesn't look like a UUID. The last thing I want is my index of time-sortable UUIDs getting contaminated with with some UUIDv4 fully random ones. Sinc…
New UUID Formats
11–20 of 172 posts
Re: New UUID Formats
#12It's a shame they didn't finally drop big endian. Little endian won out and our newer protocols should reflect that for efficiency's sake.
Re: New UUID Formats
#13UUIDv7 looks interesting, but how is it different from ULID [1] in practice? I was considering using ULID for a upcoming new project because it is lexicographically sortable but it looks like UUIDv7 just can replace that. [1]: https://cran.r-project.org/web/packages/ulid/vignettes/intro...
Functionally, UUIDv7 might be the _same_ but the hope would be for a more rigid specification for interoperability.
[1]: https://github.com/ahawker/ulid
Re: New UUID Formats
#14https://datatracker.ietf.org/doc/html/draft-peabody-dispatch...
Re: New UUID Formats
#15Old-school formatting of the same document: https://datatracker.ietf.org/doc/html/draft-peabody-dispatch...
Re: New UUID Formats
#16Re: New UUID Formats
#17It's a shame they didn't finally drop big endian. Little endian won out and our newer protocols should reflect that for efficiency's sake.
Re: New UUID Formats
#18Side note: I love the HTML format of these IETF RFCs, as in TFA. Over the decades, I was used to seeing the old text format (which I like), but this one is particularly easy on the eye, especially on my Android phone.
Re: New UUID Formats
#19UUIDs have historically massively screwed up endian handling. While this new draft discusses sorting UUIDs as strings of octets (bytes) and the text of RFC4122 is fairly explicit about most significant bytes coming first, the C UUID structure in RFC 4122 appendix A is entirely misguided:
typedef struct {
unsigned32 time_low;
unsigned16 time_mid;
unsigned16 time_hi_and_version;
unsigned8 clock_seq_hi_and_reserved;
unsigned8 clock_seq_low;
byte node[6];
} uuid_t;
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.
Re: New UUID Formats
#20It's a shame they didn't finally drop big endian. Little endian won out and our newer protocols should reflect that for efficiency's sake.