Fix hash function

This didn't make much sense and caused a lot of hash collisions,
letting the hashtable degenerate into a linear list.

Signed-off-by: wm4 <wm4@nowhere>