mirror of
https://gitee.com/johng/gf
synced 2026-07-06 21:45:34 +08:00
目录结构调整
This commit is contained in:
20
gexample/encoding/ghash.go
Normal file
20
gexample/encoding/ghash.go
Normal file
@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"fmt"
|
||||
"gf/g/encoding/ghash"
|
||||
)
|
||||
|
||||
func main () {
|
||||
m := make(map[uint64]bool)
|
||||
for i := 0; i < 100000000; i++ {
|
||||
hash := ghash.BKDRHash64([]byte("key_" + strconv.Itoa(i)))
|
||||
if _, ok := m[hash]; ok {
|
||||
fmt.Printf("duplicated hash %d\n", hash)
|
||||
} else {
|
||||
m[hash] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user