Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
/ vaporch Public archive

[WIP] A fast, general purpose consistent hashing implementation for Go

License

Notifications You must be signed in to change notification settings

jamiealquiza/vaporch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

vaporCH

Is a fast, general purpose, consistent hashing implementation for Go.

BenchmarkGet-8          30000000                39.9 ns/op             0 B/op          0 allocs/op

Example

package main

import (
        "fmt"

        "github.com/jamiealquiza/vaporch"
)

func main() {
        r, _ := vaporch.New(&vaporhr.Config{
                Nodes: []string{"node-a", "node-b", "node-c", "node-d", "node-e"},
        })

        for _, key := range []string{"apple", "pear", "lemon", "pepper"} {
                fmt.Printf("Node for %s: %s\n", key, r.Get(key))
        }
}

Output:

Node for apple: node-a
Node for pear: node-e
Node for lemon: node-b
Node for pepper: node-a

About

[WIP] A fast, general purpose consistent hashing implementation for Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages