You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Test function, the hash will be changed: hash.Write(data)。 So it's concurrency security?
func (b*BloomFilter) Test(data []byte) bool {
lower, upper:=hashKernel(data, b.hash)
// If any of the K bits are not set, then it's not a member.fori:=uint(0); i<b.k; i++ {
ifb.buckets.Get((uint(lower)+uint(upper)*i)%b.m) ==0 {
returnfalse
}
}
returntrue
}
funchashKernel(data []byte, hash hash.Hash64) (uint32, uint32) {
hash.Write(data)
sum:=hash.Sum(nil)
hash.Reset()
returnbinary.BigEndian.Uint32(sum[4:8]), binary.BigEndian.Uint32(sum[0:4])
}
The text was updated successfully, but these errors were encountered:
In Test function, the hash will be changed:
hash.Write(data)
。 So it's concurrency security?The text was updated successfully, but these errors were encountered: