// Add adds s to the set of strings represented by b.
Add adds s to the set of strings represented by b.
// Add adds s to the set of strings represented by b .
func (b *bloomFilter) Add(s string) {
	h := uint32(fnv32Offset)
	for i := 0; i < len(s); i++ {
		h ^= uint32(s[i])
		h *= fnv32Prime
	}
	b.setBit(h % bloomFilterBits)
	for i := 1; i < bloomFilterHashes; i++ {
		h ^= fnv32Offset
		h *= fnv32Prime
		b.setBit(h % bloomFilterBits)
	}
}
func ( b * bloomFilter ) Add ( s string ) { h := uint32 ( fnv32Offset ) for i := 0 ; i < len ( s ) ; i ++ { h ^= uint32 ( s [ i ] ) h *= fnv32Prime } b . setBit ( h % bloomFilterBits ) for i := 1 ; i < bloomFilterHashes ; i ++ { h ^= fnv32Offset h *= fnv32Prime b . setBit ( h % bloomFilterBits ) } }
Add adds s to the set of strings represented by b.
Add adds s to the set of strings represented by b .
// Calculate FNV-1a hash of s, and set corresponding bit. // Calculate additional hashes, and set those bits as well.