jedisct1 / rust-bloom-filter

A fast Bloom filter implementation in Rust
BSD 2-Clause "Simplified" License
235 stars 51 forks source link

Switch to xx as the bloom filter hash #11

Closed durch closed 5 years ago

durch commented 5 years ago

Use xx hash instead of sip hash. I've left sip hash in for now, but it would probably make sense to feature flag different hash implementations. If you're on board with this PR I can add that as well (or remove sip all together).

From my understanding of this implementation the choice of hash should not make a difference regarding bloom filter properties. I might be wrong there so feel free to correct me :)

jedisct1 commented 5 years ago

It really depends on your use case, but if the data being hashed comes from untrusted 3rd parties, a cryptographic hash function is absolutely needed.

I fact, I don’t remember of any case where I had a bloom filter that did not require a cryptographic hash function.

So, having something insecure as a default doesn’t seem to be a good idea. And for current users, that would be quite of a regression.

durch commented 5 years ago

I have to admit my experience with bloom filters is rather limited. I figured that the main point is to spread the bits around evenly, or at least that is my use case. I'll continue with xx in a fork, as the scenarios I have in mind require speed.

Thank you for a great starting point :)