Hamming distance in TypeScript.
There are other pure JS hamming distance libraries out there that I could have written a TypeScript declaration file for, but I wanted to learn about writing and publishing TypeScript libraries and I needed hamming distance computation for another project.
npm install --save hamming-distance-ts
Now you can have your Hamming distances and some types too!
import { hammingDistance } from "hamming-distance-ts";
const hexString1 = "deadbeef" // these could also be Buffers
const hexString2 = "deadbeff"
const hd = hammingDistance(hexString1, hexString2)
// hd === 1
MIT