package main
import (
"encoding/binary"
"fmt"
"math"
"github.com/gogf/gf/v2/encoding/ghash"
)
func main() {
var (
m = make(map[uint64]struct{})
b = make([]byte, 8)
ok bool
hash uint64
)
for i := uint64(0); i < math.MaxUint64; i++ {
binary.LittleEndian.PutUint64(b, i)
hash = ghash.PJW64(b)
if _, ok = m[hash]; ok {
fmt.Println("repeated found:", i)
break
}
m[hash] = struct{}{}
}
}