https://github.com/beefsack/go-jch
Jump Consistent Hash implementation in Go
https://github.com/beefsack/go-jch
Last synced: 3 months ago
JSON representation
Jump Consistent Hash implementation in Go
- Host: GitHub
- URL: https://github.com/beefsack/go-jch
- Owner: beefsack
- License: mit
- Created: 2015-03-19T13:21:56.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-19T13:40:31.000Z (almost 11 years ago)
- Last Synced: 2024-06-20T17:31:23.114Z (over 1 year ago)
- Language: Go
- Size: 121 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://godoc.org/github.com/beefsack/go-jch) [](https://travis-ci.org/beefsack/go-jch)
Package jch provides an implementation of the Jump Consistent Hash
consistent hashing algorithm in Go.
Consistent hashing is designed to minimise hash changes when the number of
buckets is changed, and is particularly useful for data sharding. More
information on consistent hashing is available at
http://en.wikipedia.org/wiki/Consistent_hashing.
Jump Consistent Hash was invented by John Lamping and Eric Veach, and is
described in the paper "A Fast, Minimal Memory, Consistent Hash Algorithm"
(2014) available at http://arxiv.org/abs/1406.2294v1.
```go
import "github.com/beefsack/go-jch"
func ExampleHash() {
hash := jch.Hash(28, 5)
fmt.Print(hash)
// Output: 2
}
```