hash

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 7 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

func SHA1 added in v1.5.0

func SHA1(str string) string

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