Skip to content

A library to calculate hashed-based key almost-even random distribution

Notifications You must be signed in to change notification settings

arnour/spread-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spread-scala

A library to calculate hashed-based key almost-even random distribution

Build Status

Installation

Example Usage

// Create a spread instance
val spreader = Spread.newSpreader("SHA-256")

// you could also use different hash implamentations
// val spreader = Spread.newSpreader("SHA-1")

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

val fraction = spreader.key(keyValue)

println(fraction) // 0.804535691348

Testing

$ make test

About

A library to calculate hashed-based key almost-even random distribution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published