top | item 34437754

(no title)

cakoose | 3 years ago

Having it be evenly divisible by all those bases is neat!

But I wouldn't say "no wasted bits" unless 120 bits is also exactly the right length for a particular use case. For example, if my use case would be served better by 64 bits, I'd prefer losing some bits to padding than extending it to 120 bits.

discuss

order

andreareina|3 years ago

If it’s served by 64 bits it’s probably served by 60 right? 64 bits is too few to generate randomly.

the_mitsuhiko|3 years ago

For URLs you can also do something else. If you know that your primary format is UUID v4 you can encode your UUIDs into nice URLs in base62 format. They come out as 23 alphanumeric characters and you can reconstruct the 128 bits of UUID perfectly from them.