1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00

布隆过滤器

This commit is contained in:
2022-03-27 10:17:21 +08:00
commit 0c3a00ba36
2 changed files with 71 additions and 0 deletions

20
bloom/boom_test.go Normal file
View File

@ -0,0 +1,20 @@
package bloom_test
import (
"fmt"
"strconv"
"testing"
"github.com/charlienet/go-mixed/bloom"
)
func TestBloom(t *testing.T) {
b := bloom.NewBloomFilter()
for i := 0; i < 1000000; i++ {
b.Add(strconv.Itoa(i))
}
fmt.Println(b.Contains(strconv.Itoa(9999)))
fmt.Println(b.Contains("ss"))
}