Jump consistent hash implementation in Go.
Based on this whitepaper from Google. Jump consistent hash takes an integer key and a total number of buckets to consider and hashes the key into one of the buckets. The algorithm achieves minimal memory consumption and fast hashing that has a small change in hashing as total buckets change.
Docs are on GoDoc
Tests can be ran with go test --cover
// Hash takes the integer key you want
// to find the bucket it is hashed to
// and the total number of buckets to consider
totalBuckets := 100
bucket := Hash(123456789, totalBuckets)
// The bucket for the key is returned
fmt.Printf("Hash(123456789, 100) is bucket %+v", bucket)