bits-and-blooms / bloom

Go package implementing Bloom filters, used by Milvus and Beego.
BSD 2-Clause "Simplified" License
2.44k stars 232 forks source link

bloom: add func to create bloom with data and m #74

Closed paralin closed 2 years ago

paralin commented 2 years ago

Ordinarily the From function will create a new zeroed data slice.

If we want to create a BloomFilter that is exactly identical to one we had previously, it's not possible.

Add a new function FromWithM which exposes the data slice as an argument so that we can reconstruct a BloomFilter that is identical in every way (data slice, m, k) to a remote BloomFilter.

paralin commented 2 years ago

Hi @lemire - please have a look when you have a chance.

lemire commented 2 years ago

Looks good.