github.com/go-board/x-go@v0.1.2-0.20220610024734-db1323f6cb15/xhash/runtime/hash_114.go (about) 1 //+build go1.14 2 3 package runtime 4 5 import ( 6 "hash/maphash" 7 ) 8 9 func String(str string) uint64 { 10 h := maphash.Hash{} 11 h.WriteString(str) 12 return h.Sum64() 13 } 14 15 func Bytes(data []byte) uint64 { 16 h := maphash.Hash{} 17 h.Write(data) 18 return h.Sum64() 19 }