github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/pkg/net/proxy/shadowsocks/bloom/README.md (about)

     1  Bloom Filter using double hashing.
     2  
     3  
     4  ```go
     5  func doubleFNV(b []byte) (uint64, uint64) {
     6      hx := fnv.New64()
     7      hx.Write(b)
     8      x := hx.Sum64()
     9      hy := fnv.New64a()
    10      hy.Write(b)
    11      y := hy.Sum64()
    12      return x, y
    13  }
    14  
    15  bf := bloom.New(1000000, 0.0001, doubleFNV)
    16  bf.Add([]byte("hello"))
    17  bf.Test([]byte("hello"))
    18  bf.Test([]byte("world"))
    19  ```