A plea to developers of non-cryptographic hash functions: Test performance with very small keys (like, 4-16 bytes). They’re extremely common. SipHash is disfavored in Rust these days because, despite having good perf on long keys, suffers a lot on very short ones.
-
-
Replying to @pcwalton
Is the use case arbitrary length data? If you’re always hashing, e.g., 4 byte data then surely you can just use the data itself. For arbitrary length data seems you could wrap the hash function with something that branches elsewhere on small length. Too naive?
1 reply 0 retweets 1 like -
Actual value is fine in many cases. If you look at pointer and integer hashes in some STL implementations, they just return the value iirc. I have done this in directed mapped caches. One may need a shift depending on how the address is calculated.
1 reply 0 retweets 1 like
I was looking into LCGs for the “int key” use case because they’re extremely simple and have nice properties.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.