@depasquale/hamming-distance
v0.0.2
Published
Calculate the Hamming distance between two hex or binary values
Downloads
1
Readme
Hamming distance
https://en.wikipedia.org/wiki/Hamming_distance
Installation
npm install @depasquale/hamming-distance
Usage
import hammingDistance from '@depasquale/hamming-distance';
const hDistBinary = hammingDistance('1111', '1110', 'binary');
// 'hex' is the default value and can be omitted.
const hDistHex = hammingDistance('ffff', 'fffe', 'hex');