hash

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2014 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Murmur3A

func Murmur3A(key []byte, seed uint32) uint32

MurmurHash3 for x86, 32-bit (MurmurHash3_x86_32)

func Murmur3C

func Murmur3C(key []byte, seed uint32) [4]uint32

MurmurHash3 for x86, 128-bit (MurmurHash3_x86_128)

func Murmur3F

func Murmur3F(key []byte, seed uint64) [2]uint64

MurmurHash3 for x64, 128-bit (MurmurHash3_x64_128)

func NewMurmur3A

func NewMurmur3A() hash.Hash32

func NewMurmur3C

func NewMurmur3C() hash.Hash32

func NewMurmur3F

func NewMurmur3F() hash.Hash64

Types

type Ketama

type Ketama struct {
	// contains filtered or unexported fields
}

func NewKetama

func NewKetama(node, vnode int) *Ketama

New create a ketama consistent hashing struct

func NewKetama2

func NewKetama2(node []string, vnode int) *Ketama

New create a ketama consistent hashing struct use exist node slice

func (*Ketama) Node

func (k *Ketama) Node(key string) string

Node get a consistent hashing node by key

type UIntSlice

type UIntSlice []uint

Convenience types for common cases UIntSlice attaches the methods of Interface to []uint, sorting in increasing order.

func (UIntSlice) Len

func (p UIntSlice) Len() int

func (UIntSlice) Less

func (p UIntSlice) Less(i, j int) bool

func (UIntSlice) Swap

func (p UIntSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL