Skip to content

mayankz/chash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

chash

Go library for consistent hashing

Usage

package main

import "fmt"
import "github.com/mayankz/chash"

func main() {
    h := chash.New()
    
    h.AddNode("a", 1)
    h.AddNode("b", 1)
    h.AddNode("c", 1)
    fmt.Println(h.GetNode("test"))
    fmt.Println(h.GetNode("test1"))
    fmt.Println(h.GetNode("test3"))

    h.RemoveNode("b")
    fmt.Println(h.GetNode("test"))
    fmt.Println(h.GetNode("test1"))
    fmt.Println(h.GetNode("test3"))
}

About

Go library for Consistent Hashing - Ketama

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages