Live data from Hacker News

Every V4 UUID

everyuuid.com

191–200 of 381 posts

Re: Every V4 UUID

#191
post #182

I tried to find the biggest UUID and if I got it right, it's 99999999-9999-4999-9999-999999999999 (note the 4 in the 3rd block) I'm curious why it's not 99999999-9999-9999-9999-999999999999 (all 9s)?

It depend on the UUID version you're using. Version 4 (Random) will always have that value be 4 as per RFC 9562. So 99999999-9999-9999-9999-999999999999 is a valid UUID but not a valid UUID v4. If you wanted to be pedantic the website should have been named https://everyuuidv4.com/

https://datatracker.ietf.org/doc/html/rfc9562

Re: Every V4 UUID

#192
post #186
post #182

I tried to find the biggest UUID and if I got it right, it's 99999999-9999-4999-9999-999999999999 (note the 4 in the 3rd block) I'm curious why it's not 99999999-9999-9999-9999-999999999999 (all 9s)?

The values are hexidecimal, so all "9s" isn't the biggest UUID, but all "f's". Specifically, I think: `ffffffff-ffff-4fff-bfff-ffffffffffff`. The "4" in the 3rd block is the only permitted value as these UUIDs are using the GUIDv4 format. I'm not sure what's going on in the 4th block, but the references and linked RFC in the Wikipedia article might reveal more details: https://en.wikipedia.org/wiki/Universally_unique…

If you're going by hex, the biggest UUID is entirely f's, 32 of them. It's defined specially and doesn't have version or variant.

Re: Every V4 UUID

#195
post #82

I looked for deadbeef-f00d-f00d-deadbeef** but did not find it. Search is just on active page, that gets ever longer?

deadbeef-f00d-f00d-deadbeef isn't a valid UUID v4 Aside from missing a grouping in the middle, you need the version and variant bits, ie: XXXXXXXX-XXXX-4XXX-VXXX-XXXXXXXXXXXX where V is 8, 9, A, or B searching for deadbeef-f00d-400d-a00d-deadbeef does return the expected matches

Your comment is needed as a parent / top-level for the discussion. A lot of people were confused about the 'V' portion in particular. Thanks for the insight.

Re: Every V4 UUID

#196

Earlier quoted context omitted.

Awesome - this will be my new coding interview question

Agreed. Everyone love puzzles that are worthy of an entire section in a blogpost for their interview questions, rather than stuff actually relevant to the job.

So I just brute forced every UUID in existence on my RTX GPU and loaded the dataset into a HA opensearch cluster on AWS. It took about 5 years of calling ‘uuid.Random()’ to effectively cover about 64% of the keyspace which is good enough.

To facilitate full-text search I created a langchain application in python, hosted on kubernetes, that takes your search query and generates synonymous UUIDs via GPT o1-preview before handing over to opensearch.

Opensearch returns another set of UUIDs, which I look up in my postgres database: “SELECT uuid FROM uuids WHERE id IN (…uuid_ids)”

Re: Every V4 UUID

#197
post #182

I tried to find the biggest UUID and if I got it right, it's 99999999-9999-4999-9999-999999999999 (note the 4 in the 3rd block) I'm curious why it's not 99999999-9999-9999-9999-999999999999 (all 9s)?

[deleted]

Re: Every V4 UUID

#198
post #186

Earlier quoted context omitted.

The values are hexidecimal, so all "9s" isn't the biggest UUID, but all "f's". Specifically, I think: `ffffffff-ffff-4fff-bfff-ffffffffffff`. The "4" in the 3rd block is the only permitted value as these UUIDs are using the GUIDv4 format. I'm not sure what's going on in the 4th block, but the references and linked RFC in the Wikipedia article might reveal more details: https://en.wikipedia.org/wiki/Universally_unique…

If you're going by hex, the biggest UUID is entirely f's, 32 of them. It's defined specially and doesn't have version or variant.

I see what you mean, but I was going by the definition of "UUID" used on everyuuid.com. The UUID of 32 "f's" isn't in the list.

Re: Every V4 UUID

#200
It's interesting insight that if you encrypt something in a way that the cipher-text is exactly as long as plain-text (counted in bits) it's as if you just listed all possible inputs and mixed them randomly.
Post reply on HN