Leap implements the jump consistent hashing algorithm proposed by John Lamping and Eric Veach.1
package main
import (
"fmt"
"github.com/gmcabrita/leap"
)
func main() {
key := uint64(42)
bucketPlacement := leap.Hash(key, 100)
fmt.Println(bucketPlacement)
}
1 "A Fast, Minimal Memory, Consistent Hash Algorithm" by John Lamping and Eric Veach. โฉ