Ask YC: Suggestions for a hash algorithm?
https://news.ycombinator.com/item?id=102683For a project I'm working on right now (an image server that dynamically generates images based on a URL and caches them on disk), I'm planning to use 20 bits worth of hash as both the directory path and a simple checksum. The string being hashed will be the filename concatenated with a secret key, which will hopefully prevent DOS attacks.
I don't really know anything about hashing... my ideas so far are to use the last 20 bits of MD5, or maybe the first 20 bits of Adler32. Even distribution is more important than speed. Can anyone offer any advice here?