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

ApproximatedSize returns wrong bloom filter size if bloom filter has 4B+(beyond uint32 range) items #103

Open satishbhor opened 5 months ago

satishbhor commented 5 months ago

This is happing because we are type casting bloom filter size estimation to uint32 and its rounding numbers back to within uint32 range, we should prefer to typecast it to uint64 so that it can derive correct result