[Answered ]-Create urls like Instagram posts or youtube video

1👍

You might choose to design around ULIDs. https://github.com/ulid/spec

It’s still 128 bits.
The engineering tradeoff they made was 48 bits of predictable low-entropy clock
catenated with an 80-bit nonce.

Starting with a timestamp makes it play very nicely with postgres B-trees.

They serialize 5 bits per character instead of the 4 bits offered by hex.
You could choose to go for 6 if you want, for the sake of brevity.

Similarly you could also choose to adjust the clock tick granularity,
and reduce its range.

Keeping the Birthday Paradox in mind,
you might choose to use a smaller nonce, as well.
The current design offers good collision resistance
up to around 2^40 identifiers per clock tick,
which might be overkill for your needs.

👤J_H

Leave a comment