News for hackers. Stuff that matters.
Re:Ask HN: Why can't we just use this idea for clean URLs wi... by jepler on Friday November 04, 2016 @09:46PM (#12877679)
1. A 32-bit hash isn't enough no matter what (birthday paradox), 64-bit might be if you don't have adversaries choosing {SLUG} strings and it's the truncation of a cryptographic hash. (compare with 32-bit public key IDs in PGP)

2. Are you going to really enforce {SLUG} being unique for the lifetime of your system?

Re:Ask HN: Why can't we just use this idea for clean URLs wi... by myf01d on Friday November 04, 2016 @10:20PM (#12877787)
Thanks for reply

1. you're right that 32-bit isn't enough for tens of thousands of slugs (maybe even thousands?), I just need to design a performant and economic url design, like in letterboxd.com

2. yes, my project is about artistic works, so the work name wont change and subsequently the slug.

Since I use Postgres which has only 32-bit and 128-bit integers, is there a considerable performance hit if I use the latter with 64-bit or 128-bit algorithm so I reduce the probability of collision?