为什么布隆过滤器需要多个哈希函数? [英] Why Does a Bloom Filter Need Multiple Hash Functions?

查看:1248
本文介绍了为什么布隆过滤器需要多个哈希函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白为什么bloom过滤器需要多个散列函数(比如SHA和MD5)。



为什么不只是例如,创建一个更大的 SHA散列,然后将其分解为多个部分并将它们视为单独的散列?在速度方面效率不是很高吗?解析方案

这个想法是使用几种不同但简单的哈希函数。如果你打算使用SHA或MD5等密码散列函数,那么你可以改变它的输入。是否更高效取决于你的散列函数的复杂程度。

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?

解决方案

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.

这篇关于为什么布隆过滤器需要多个哈希函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆