Skip to content

A library to calculate hashed-based key distribution

Notifications You must be signed in to change notification settings

arnour/spread-go

Repository files navigation

spread

A library to calculate hashed-based key distribution

Build Status

Installation

$ go get github.com/arnour/spread-go

Example Usage

// Create a spread instance
spreader := spread.New(nil)

// you could also use different hash implamentations
// spreader := spread.New(sha256.New())

keyValue := "my-key-to-hash"

fraction := spreader.Key(keyValue)

fmt.Println(fraction) // 0.804535691348

Testing

$ make test

About

A library to calculate hashed-based key distribution

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published