Project

hamming

0.0
No release in over a year
Hamming calculations
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Hamming

Install

gem install hamming

Usage

Hamming calculates the distance between two hashes or two vectors.

Distance

Since hashes exist on a metric space you can measure how far a hash is from another.

hash_a = "859091ce633aaebb"
hash_b = "859091ce633aaeba"
Hamming.distance(hash_a, hash_b)

# You can also transform hashes based on your storage:
Hamming.vector_to_hash(hash)
Hamming.hash_to_vector(vector)