Why Does a Bloom Filter Need Multiple Hash Functions?

≯℡__Kan透↙ 提交于 2019-12-08 07:01:00

问题


I don't really understand why a bloom filter requires multiple hash functions (say, SHA and MD5).

Why not just make a bigger SHA hash, for example, and then break it up into multiple parts and treat them as separate hashes? Isn't that more efficient in terms of speed?


回答1:


The idea is to use several different but simple hash functions. If you're going to use some cryptographic hash function like SHA or MD5 then you could just vary the input to it. Whether it's more efficient depends how complex your hash functions are.




回答2:


It's called triple/double hashing, it minimizes the chance of collisions, probability of collision occurring with 5 hash functions, is 5 times smaller than with one hash function.



来源:https://stackoverflow.com/questions/6606642/why-does-a-bloom-filter-need-multiple-hash-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!