UNPKG

xor-distance

Version:

Calculate the distance between two buffers as a new buffer and compare computed distances with eachother

7 lines (4 loc) 188 B
var distance = require('./') var dist1 = distance(new Buffer('foo'), new Buffer('bar')) var dist2 = distance(new Buffer('foo'), new Buffer('baz')) console.log(distance.gt(dist1, dist2))