Goodbye integers, hello UUIDv7
141–150 of 376 posts
Re: Goodbye integers, hello UUIDv7
#142Analyzing New Unique Identifier Formats (UUIDv6, UUIDv7, and UUIDv8) (2022) https://news.ycombinator.com/item?id=36438367
Re: Goodbye integers, hello UUIDv7
#143Earlier quoted context omitted.
Given that a UUID identifier fits in a single cipher block, and the whole point is that these are unique by construction (no IV needed so long as that holds true), it seems like a single round of ECB-mode AES-128 would enable quickly converting between internal/external identifiers. 128 bits -> 128 bits
Why not just use the AES-128 result as the UUID then? What's the benefit of the internal structure at all? If AES-128 is an acceptable external UUID (and likely an acceptable internal one), then you might as well just stick with a faster RNG.
The whole point here would be that you can expose something opaque externally but benefit from well behaved index keys internally.
Re: Goodbye integers, hello UUIDv7
#144Earlier quoted context omitted.
Is there a way to encrypt 122 bits -> 122 bits? If so – do that and set version to 4. Alternatively, just say it's a random string ID and not an UUID.
I'm actually working on encrypting database keys like this, and I opted for a string ID with "url safe" base64. It avoids the ambiguity of looking like a UUID when it's not, and I prefer "o3Ru98R3Qw-_x2MdiEEdSQ" in a URL over "a3746ef7-c477-430f-bfc7-631d88411d49". (Not that either one is very beautiful)
Re: Goodbye integers, hello UUIDv7
#145How long will it be before the “milliseconds since epoch” part of the uuid overflows or repeats?
$ date -ud @$(( 256 ** 6 / 1000 ))
Tue Aug 2 05:31:50 AM UTC 10889Re: Goodbye integers, hello UUIDv7
#146Earlier quoted context omitted.
Given that a UUID identifier fits in a single cipher block, and the whole point is that these are unique by construction (no IV needed so long as that holds true), it seems like a single round of ECB-mode AES-128 would enable quickly converting between internal/external identifiers. 128 bits -> 128 bits
This seems overly complex, and you need some kind of key too. Why not just hash it with pretty much any hash function?
If you didn’t care about index clustering then just use UUIDv4
Re: Goodbye integers, hello UUIDv7
#147UUIDv7 is a nice idea, and should probably be what people use by default instead of UUIDv4 for internal facing uses. For the curious: * UUIDv4 are 128 bits long, 122 bits of which are random, with 6 bits used for the version. Traditionally displayed as 32 hex characters with 4 dashes, so 36 alphanumeric characters, and compatible with anything that expects a UUID. * UUIDv7 are 128 bits long, 48 bits encode a unix tim…
100 years sounds short-sighted for something that's supposed to be "universally" unique. We're already having problems with the 32-bit Unix timestamp not being large enough. If you're willing to use 160-bit (or longer) identifiers, you might as well give a few more bits to the timestamp. Round it up to an even number of base-62 characters, too. That part of KSUID has always struck me as a weird decision. I wish UUIDv…
Re: Goodbye integers, hello UUIDv7
#148Re: Goodbye integers, hello UUIDv7
#149Re: Goodbye integers, hello UUIDv7
#150Earlier quoted context omitted.
In ye olden days you had a minion sitting in a car watching the front gate with a notepad and enough cigarettes to last the night. Pizza itself might be a bit of a joke but looking for non-operational behavioral changes is absolutely real. The Cuban missile crisis was started in part because soviets played soccer and Cubans played baseball and the presence of soccer fields helped confirm soviet presence (in enough nu…
> soviets played soccer and Cubans played baseball It's a Henri Kissinger's quote, but it's not accurate: Cubans do in fact play football. Also this quote wasn't from the 1962 Cuban missile crisis, but to another event in 1970. That being said, it is true that the US intelligence got warned by the construction of football fields (or maybe even more so by the lack of baseball grounds). https://www.cracked.com/article_…