5 ms·
I always go for Hashids (https://hashids.org/ https://hashids.org/)
by zlib 4y ago
I always go for Hashids (https://hashids.org/ https://hashids.org/)
- hoherd 4y agoFwiw, hashids do not solve OP's use case: > Hashids is a small open-source library that generates short, unique, non-sequential ids from numbers. vs the summary in the article: > So now when I list atoms from my filesystem or in S3, they come back in the same order that I wrote them.
- tokumei 4y agoHashids are nice
- vore 4y agoI've never been sure of the use case of hashids. They're not really a security measure since they can be easily defeated; you might as well just expose the sequential ID at that point. If you do need something with better properties, you should probably be using UUIDv6.
- junon 4y ago> they can be easily defeated How? I mean they're of course no cryptographic measure but with the salt you have some secrecy.
- paulgb 4y agoIf an attacker can generate sequential hashids, they can decipher the alphabet order that hashids use without needing to know the seed, and then use the seed to invert other hashids. I wrote a library that generates short IDs with the goal of making the similarity between two codes have nothing to do with sequence order. https://docs.rs/block-id/latest/block_id/ https://docs.rs/block-id/latest/block_id/