24 ms·
I hate UUIDv4, don't care about the rest. UUIDv4 is just random bytes with hyphens inserted in random places and some bytes reserved to indicate that this is in
by efilife 7mo ago
I hate UUIDv4, don't care about the rest. UUIDv4 is just random bytes with hyphens inserted in random places and some bytes reserved to indicate that this is in fact a UUID. This is wasteful and stupid
- matja 7mo agoYou aren't supposed to store the hyphens, and that's the same for all versions.
- efilife 7mo agoWhat if I want an ID in the URL? Parse it back and forth? And what if for example, nodejs's UUID api only gives me the string representation of the ID?
- matja 7mo agoTo minimize the storage space while having a URL-safe representation, yeah you'd want to serialise/deserialise on the boundary of presenting it to API consumers. I think the same for any ID that has an efficient binary representation as well as needing to represent it in ASCII.
- Dylan16807 7mo agoIs reserving 6 bits really that bad? You can use different encodings based on context, just like with a random blob of bytes.