hashbrown icon indicating copy to clipboard operation
hashbrown copied to clipboard

ahash shouldn't be the default Hasher

Open jedisct1 opened this issue 1 year ago • 3 comments

See https://github.com/tkaitchuck/aHash/issues/163

It's also currently completely broken on ARM: https://github.com/tkaitchuck/aHash/issues/166

jedisct1 avatar Oct 18 '23 11:10 jedisct1

Hashbrown specifically doesn't make any guarantees about hash function security. The only reason we don't use FxHash by default is because it gives poor results if the input values are all multiples of the same value (e.g. all multiples of 4).

Amanieu avatar Oct 18 '23 13:10 Amanieu

Curious, what is the best hasher if one only cares about perf?

jestarray avatar Oct 26 '23 21:10 jestarray

It's an unanswerable question. You can make an arbitrarily fast hasher by reducing the quality of the output. For example, only hash the first 16 bytes of input strings, or even just return a constant value. Both of those are legal Hasher implementations.

thomcc avatar Oct 27 '23 03:10 thomcc