3 ms·
So UUIDs were the perfect solution except that, if a user double-click a url with a UUID in it, it won’t select all of it. Can’t you just… remove the hyphens?
by HippoBaro 5y ago
So UUIDs were the perfect solution except that, if a user double-click a url with a UUID in it, it won’t select all of it.
Can’t you just… remove the hyphens? UUIDs are just arrays of bytes, the hyphens are not part of the data.
Instead, they use a less popular, less supported, more collision-prone ID format.
- jamesboehmer 5y agoYou can also base62-encode the UUID's underlying integer and you get a short, URL-friendly identifier, while maintaining the power and uniformity of UUID. The claim with nanoID is that it's twice as fast as UUID, but I'm not sure how impactful that is given my services all spent orders of magnitude more time in I/O wait for a database after any UUID functionality.
- maxekman 5y agoExactly, I’m surprised this would gain traction. UUIDs are much smaller when packed into bytes. Notion seems to use UUIDs without hyphens in their links, and it works just fine.
- greatgib 5y agoNanoid are really great. It is a smarter uuid4 with variable size and alphabet. It is also a lot faster to generate. See that: https://blog.bitsrc.io/why-is-nanoid-replacing-uuid-1b5100e62ed2 https://blog.bitsrc.io/why-is-nanoid-replacing-uuid-1b5100e6... By definition, if you base62 or base64 your uuid4 it will be longer (30%?). This generate directly in the final encoding so it is a lot shorter. Based on the simulator calculation, you just need 24 chars to be equivalent to an uuid4 that is 35 chars. But being able to determine the length of the resulting id is one of the greatest feature. Did it never happened to you the case that you would like a shorter uuid4 and think that you can just truncate it? Not realizing that some parts of the uuid have a special meaning and are not random...