6 ms·
Just have a database of UUIDs. Seems pretty trivial to generate and sort as it's only 16 bytes each.
by throwaway808081 7mo ago
Just have a database of UUIDs. Seems pretty trivial to generate and sort as it's only 16 bytes each.
- dullcrisp 7mo agohttps://libraryofbabel.info/ https://libraryofbabel.info/
- stirfish 7mo agolol Let's go a step further and just iterate through them on the client. I plan on having this phone well past the heat death of the universe, so this is guaranteed to finish on my hardware. function* uuidIterator() { const bytes = new Uint8Array(16); while (true) { yield formatUUID(bytes); let carry = 1; for (let i = 15; i >= 0 && carry; i--) { const sum = bytes[i] + carry; bytes[i] = sum & 0xff; carry = sum > 0xff ? 1 : 0; } if (carry) return; } } function formatUUID(b) { const hex = [...b].map(x => x.toString(16).padStart(2, "0")); return ( hex.slice(0, 4).join("") + "-" + hex.slice(4, 6).join("") + "-" + hex.slice(6, 8).join("") + "-" + hex.slice(8, 10).join("") + "-" + hex.slice(10, 16).join("") ); } This is free. Feel free to use it in production.
- b00ty4breakfast 7mo agoFree space heater
- deleted 7mo ago[deleted]
- Velocifyer 7mo agoWhat license is this? Company policy says we can't use Apache licensed stuff.
- Dylan16807 7mo ago"Just" have a database, and then what? I can set up a database of all UUIDs very easily, but I don't think it's helpful.
- direwolf20 7mo agoWhere are you storing them, a black hole?
- Dylan16807 7mo agoAll you need is basic compression, like storing the start and stop points of each block of UUIDs in the database. Wait, you already linked to everyuuid. Do you think the server it's on uses black hole storage?
- techpression 7mo agoFast writes, very slow reads.
- seg_lol 7mo agoI would store them as offsets within the digits of pi.
- pshirshov 7mo agoThat's actually a bright idea! Have you ever thought about applying for VC funds? Once you deliver that, you can also think about a database of natural numbers!
- deleted 7mo ago[deleted]
- phanimahesh 7mo agoBut that has no moat. Anyone can generate a database of natural numbers using SOTA models.
- deleted 7mo ago[deleted]
- voussoir 7mo agoRelevant: https://news.ycombinator.com/item?id=42342382 https://news.ycombinator.com/item?id=42342382
- direwolf20 7mo agoIt exists https://everyuuid.com/ https://everyuuid.com/
- xhcuvuvyc 7mo agoWoosh
- direwolf20 7mo agosomeone took your joke and made it real
- fragmede 7mo agoThe write-up for it is surprisingly interesting! https://eieio.games/blog/writing-down-every-uuid/#toc:entropy-and-bijectivity https://eieio.games/blog/writing-down-every-uuid/#toc:entrop...
- Mikhail_Edoshin 7mo ago16 bytes is a lot. 4 bytes are within reach, we can scan all of them quickly, but even 8 bytes are already too much. Kolmogorov said that computers do not help with naturally hard tasks; they raise a limit compared to what we can fo manually, but above that limit the task stays as hard is it was.