1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
package farmhash
// farmhash.go is the Public interface to farmhash.
// There are some additional functions in farmhousecc.go
const (
Version = "1.0.0"
)
// These functions based on original C++ namespace util
func Hash32(s []byte) uint32 {
return mkHash32(s)
}
func Hash32WithSeed(s []byte, seed uint32) uint32 {
return mkHash32WithSeed(s, seed)
}
func Hash64(s []byte) uint64 {
return naHash64(s)
}
func Hash64WithSeed(s []byte, seed uint64) uint64 {
return naHash64WithSeed(s, seed)
}
func Hash64WithSeeds(s []byte, seed0, seed1 uint64) uint64 {
return naHash64WithSeeds(s, seed0, seed1)
}
func Hash128(s []byte) Uint128 {
return Fingerprint128(s)
}
func Hash128WithSeed(s []byte, seed Uint128) Uint128 {
return CityHash128WithSeed(s, seed)
}
func FingerPrint32(s []byte) uint32 {
return mkHash32(s)
}
func FingerPrint64(s []byte) uint64 {
return naHash64(s)
}
|