Skip to content

Implementation of the Jump Consistent Hash algorithm in Go.

License

Notifications You must be signed in to change notification settings

benbjohnson/jmphash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jmphash

Implementation of the Jump Consistent Hash algorithm in Go. This algorithm performs consistent hashing on integer keys and maps them to integer buckets.

Usage

To use jmphash, simply create a Hasher with the number of buckets you want to map to and then call the Hash() function with your key. This function will return the bucket that your key is mapped to.

import "github.com/benbjohnson/jmphash"

func main() {
	// Create a hash with 100 buckets.
	h := jmphash.NewHasher(100)

	// Map keys to their appropriate buckets.
	bucket := h.Hash(12387)
}

About

Implementation of the Jump Consistent Hash algorithm in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages