【源码解析】布隆过滤器之bitset篇
Github源码:https://github.com/bits-and-blooms/bloom
比如说要创建一个布隆过滤器
m=1000,k=4 (创建的bitset大小为1000,判断是否存在时check4次)
func New(m uint, k uint) *BloomFilter {
return &BloomFilter{max(1, m), max(1, k), bitset.New(m)}
}
那么bitset需要开辟多大空间呢?
开辟 wordsNeeded(le.
原创
2021-09-08 22:24:38 ·
542 阅读 ·
0 评论