Skip to content

A library to calculate hashed-based key distribution

Notifications You must be signed in to change notification settings

arnour/spread-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b45a346 · Jan 27, 2020

History

7 Commits
Jan 24, 2020
Jan 24, 2020
Jan 24, 2020
Jan 24, 2020
Jan 24, 2020
Jan 24, 2020
Jan 24, 2020
Jan 24, 2020
Jan 27, 2020
Jan 24, 2020
Jan 24, 2020
Jan 24, 2020
Jan 24, 2020

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