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: expose bitset with a func #65

Closed paralin closed 3 years ago

paralin commented 3 years ago

to access the underlying BitSet inside the bloom filter

In some cases it's necessary to access the []uint64 representation within.

db7 commented 3 years ago

Isn't https://pkg.go.dev/github.com/bits-and-blooms/bloom#From enough? AFAIR, From uses the passed slice (does not copy it). So if you keep a reference to the slice, you always have access to its bits.

paralin commented 3 years ago

@db7 No, because the constants are not the same (m, k, bitset len)

lemire commented 3 years ago

I'll merge and fix the comment.