Project

jumphash

0.1
No commit activity in last 3 years
No release in over 3 years
Jump consistent hash implementation for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 5.0
~> 10.0
~> 0.4
 Project Readme

Jumphash

Build Status

MRI Ruby implementation of the jump consistent hash algorithm by John Lamping and Eric Veach of Google.

Installation

Add this line to your application's Gemfile:

gem "jumphash"

And then execute:

$ bundle

Or install it yourself as:

$ gem install jumphash

Usage

require "jumphash"
require "xxhash"

JumpHash.hash_key(314159265359, 256)
# => 80

JumpHash.hash_string("foobar", 256) { |str| XXhash.xxh64(str) }
# => 76

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/cdolan/jumphash. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.