Skip to content

aylesford/consistent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

consistent

This package of consistent is the most concise and efficient algorithm of consistent hash based on golang.

Example

Quick start:

package main

import (
	"fmt"
	"github.com/aylesford/consistent"
)

func main() {
	c := consistent.New()

	c.Add("aa", "bb", "cc")

	fmt.Println(
		c.Get("AAAA"), 
		c.Get("BBBB"), 
		c.Get("CCCC"), 
		c.Get("DDDD"),
		c.Get("EEEE"),
		c.Get("FFFF"),
	)
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages