Documentation ¶
Index ¶
- func Hash(key uint64, buckets int32) int32
- func HashString(s string) uint64
- func JumpConsistentHash(len int, options ...interface{}) int
- func Md5Byte(s []byte) string
- func Md5File(path string) (string, error)
- func Md5String(s string) string
- func Sha1Byte(s []byte) string
- func Sha1File(path string) (string, error)
- func Sha1String(s string) string
- func Sha256Byte(s []byte) string
- func Sha256File(path string) (string, error)
- func Sha256String(s string) string
- func Sha512Byte(s []byte) string
- func Sha512File(path string) (string, error)
- func Sha512String(s string) string
- type ConsistentAddrStrFunction
- type HashServiceAndArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hash ¶
Hash consistently chooses a hash bucket number in the range [0, numBuckets) for the given key. numBuckets must be >= 1.
func JumpConsistentHash ¶
JumpConsistentHash selects a server by serviceMethod and args
Types ¶
type ConsistentAddrStrFunction ¶
type ConsistentAddrStrFunction func(options ...interface{}) string
ConsistentFunction define a hash function Return service address, like "tcp@127.0.0.1:8970"
type HashServiceAndArgs ¶
HashServiceAndArgs define a hash function
Click to show internal directories.
Click to hide internal directories.