Exercise 38. Hashmap Algorithms

There are three hash functions that you’ll implement in this exercise:

FNV-1a Named after the creators Glenn Fowler, Phong Vo, and Landon Curt Noll, this hash produces good numbers and is reasonably fast.

Adler-32 Named after Mark Adler, this is a horrible hash algorithm, but it’s been around a long time and it’s good for studying.

DJB Hash This hash algorithm is attributed to Dan J. Bernstein (DJB), but it’s difficult to find his discussion of the algorithm. It’s shown to be fast, but possibly not great numbers.

You’ve already seen the Jenkins hash as the default hash for the Hashmap data structure, so this exercise will be looking at these three new hash functions. The code for them is usually small, and it’s ...

Get Learn C the Hard Way: A Clear & Direct Introduction To Modern C Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.