import "github.com/andy2046/gopie/pkg/jumphash"
Package jumphash provides a jump consistent hash implementation.
func Hash(key uint64, buckets int) intHash takes a key and the number of buckets, returns an integer in the range [0, buckets). If the number of buckets is not greater than 1 then 1 is used.
func HashString(key string, buckets int) intHashString takes string as key instead of integer and uses CRC-64 to generate key.
type Hasher struct {
// contains filtered or unexported fields
}Hasher represents a jump consistent Hasher using a string as key.
func New(n int) *HasherNew returns a new instance of of Hasher.
func (h *Hasher) Hash(key string) intHash returns the integer hash for the given key.
func (h *Hasher) N() intN returns the number of buckets the hasher can assign to.
Generated by godoc2md