hash

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(data []byte, seed uint32) uint32

Types

type ConsistentHash

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

func NewConsistentHash

func NewConsistentHash() *ConsistentHash

func NewConsistentHash2

func NewConsistentHash2(virtual int) *ConsistentHash

func (*ConsistentHash) Add

func (c *ConsistentHash) Add(id string) error

func (*ConsistentHash) Get

func (c *ConsistentHash) Get(data string) (*Node, error)

func (*ConsistentHash) Remove

func (c *ConsistentHash) Remove(id string) error

Remove node by id, include virtual node.

type Node

type Node struct {
	Val string
	// contains filtered or unexported fields
}

type Nodes

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

Jump to

Keyboard shortcuts

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