4 ms·
Good to know. I was using FNV to hash spam signatures which are typically small. Glad I chose well.
by baudehlo 11y ago
Good to know. I was using FNV to hash spam signatures which are typically small. Glad I chose well.
- jorangreef 11y agoIf your spam signatures are small (around 32 bytes) and fixed size, you might also want to look into a pure XOR tabulation hash. It's excellent for generating fixed-size keys for hash tables: http://www2.imm.dtu.dk/projects/thrash-workshop/slides/thorup.pdf http://www2.imm.dtu.dk/projects/thrash-workshop/slides/thoru... https://en.wikipedia.org/wiki/Tabulation_hashing https://en.wikipedia.org/wiki/Tabulation_hashing I use it all the time when I need a hash table index. It's simple to understand, safe and fast. Even though it can generate more assembly than other hashes, it's actually often faster because it has no multiply operation, only XOR. If the tables are small enough to fit into cache (i.e. small keys), it's brilliant. It has properties suitable for triangular probing, where other hashes sometimes don't have enough independence. And if you need a rolling hash, i.e. for Rabin Karp, it's also perfect.