Skip to content

hamming distance

Subhajit Sahu edited this page May 5, 2020 · 1 revision

Get Hamming distance between strings.

const hammingDistance = require('string-hammingdistance');
// hammingDistance(<string-1>, <string-2>)

hammingDistance('rowan', 'raven');
// 3
hammingDistance('atkinson', 'atkinson');
// 0
hammingDistance('bean', 'green');
// NaN (strings are of different length)

extra-string

Clone this wiki locally