func (f *Filter) Contains(v hash.Hash64) bool {
	f.lock.RLock()
	defer f.lock.RUnlock()
	r := uint64(1)
	for _, i := range f.hash(v) {
		i %= f.m
		r &= (f.bits[i>>6] >> uint(i&0x3f)) & 1
	}
	return uint64ToBool(r)
}
Contains tests if f contains v
false: f definitely does not contain value v
true:  f maybe contains value v
package bloomfilter
import (
	"hash"
	"sync"
)
type Filter struct {
	lock sync.RWMutex
	bits []uint64
	keys []uint64
	m    uint64  
	n    uint64  
}
func (f *Filter) hash(v hash.Hash64) []uint64 {
	rawHash := v.Sum64()
	n := len(f.keys)
	hashes := make([]uint64, n)
	for i := 0; i < n; i++ {
		hashes[i] = rawHash ^ f.keys[i]
	}
	return hashes
}
func (f *Filter) M() uint64 {
	return f.m
}
func (f *Filter) K() uint64 {
	return uint64(len(f.keys))
}
func (f *Filter) Add(v hash.Hash64) {
	f.lock.Lock()
	defer f.lock.Unlock()
	for _, i := range f.hash(v) {
		i %= f.m
		f.bits[i>>6] |= 1 << uint(i&0x3f)
	}
	f.n++
}