hamming-distance Usage var compare = require('hamming-distance'); var distance = compare(new Buffer('0000', 'hex'), new Buffer('000F', 'hex'));