TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Bloom Filters for the Perplexed

259 点作者 kedmi超过 7 年前

6 条评论

voidmain超过 7 年前
Bloom filters are a nice data structure, and you should absolutely have them in your toolbox, but if you go looking for a reason to use one you are likely to wind up making things worse. The following is not valid reasoning: &quot;Bloom filters are efficient. Therefore if I can find a way to use a bloom filter, my solution will be efficient.&quot;<p>The &quot;SSH keys&quot; protocol in the article seems like an example of this. It doesn&#x27;t make any sense. Why would the server send the client a Bloom filter if the client has already told it what key it wants to check? The server only has to send one bit back to the client! And if the goal is to not trust the server with the client&#x27;s (public) key, this protocol doesn&#x27;t accomplish that either.<p>And if you do for some reason have to transmit the entire database of compromised SSH keys in a way that permits only membership tests, a Bloom filter isn&#x27;t the most compact way to do it! For example, off the top of my head, you could calculate an (15+N)-bit hash for each element of the list, sort the hashes, and rice code the deltas. That would take very roughly 32768 * (N+2) bits and give about 1 in 2^N false positives. So for N=13 it is about the size of the bloom filter in the article but gives a false positive rate 8 times lower. This data structure isn&#x27;t random access like a Bloom filter, but that doesn&#x27;t matter for something you are sending over the network (which is always O(N)).
评论 #15361291 未加载
评论 #15360039 未加载
评论 #15361472 未加载
malkia超过 7 年前
When I first heard of Bloom filters, I thought of the Bloom effect - <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bloom_(shader_effect)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bloom_(shader_effect)</a> - and we used to call these things filters for a while - then friend of mine told me about the other meaning :)
评论 #15360407 未加载
评论 #15359113 未加载
captaintacos超过 7 年前
Some weeks ago someone posted a very useful interactive demo of a bloom filter (implemented in js) that you might want to play with after reading this article: <a href="https:&#x2F;&#x2F;www.jasondavies.com&#x2F;bloomfilter&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.jasondavies.com&#x2F;bloomfilter&#x2F;</a>
tzs超过 7 年前
How does a Bloom filter with k hash functions hashing to a shared table of m bits compare to just using k hash functions each hashing into its own separate hash table of m&#x2F;k bits?
评论 #15360369 未加载
评论 #15360254 未加载
评论 #15360016 未加载
jason_slack超过 7 年前
Can anyone tell me about a use case in game design?
评论 #15359788 未加载
评论 #15360074 未加载
oli5679超过 7 年前
Every month or so there is a new version of an article like this posted on hn
评论 #15358614 未加载
评论 #15358749 未加载
评论 #15358724 未加载
评论 #15361058 未加载