mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 08:32:40 +08:00
布隆过滤器
This commit is contained in:
20
bloom/boom_test.go
Normal file
20
bloom/boom_test.go
Normal 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"))
|
||||
}
|
Reference in New Issue
Block a user