Skip to content

Dai0522/go-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
戴巍
May 18, 2020
384bacd · May 18, 2020

History

13 Commits
May 18, 2020
Oct 29, 2018
May 18, 2020
Oct 11, 2018
Oct 15, 2018
May 18, 2020
May 18, 2020

Repository files navigation

go-hash

murmur3_128 + bloom filter

usage

bf, _ := bloomfilter.New(100000, 0.0001)
for i := 0; i < 100000; i++ {
    bf.PutUint64(uint64(i))
}

total := 0
fail := 0
for i := 100001; i < 1100001; i++ {
    if bf.MightContainUint64(uint64(i)) {
        fmt.Println(i)
        fail++
    }
    total++
}
fmt.Println(total, fail)
b, err := ioutil.ReadFile("bf.txt")
if err != nil {
    fmt.Print(err)
}
bf, _ := bloomfilter.Load(&b)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages