xor-distance

2.0.0 • Public • Published

xor-distance

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

npm install xor-distance

build status

Usage

var distance = require('./')
 
var dist1 = distance(new Buffer('foo'), new Buffer('bar'))
var dist2 = distance(new Buffer('foo'), new Buffer('baz'))
 
// the following returns true since the distance between foo and bar
// is greater than the distance between foo and baz
console.log(distance.gt(dist1, dist2))

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i xor-distance

Weekly Downloads

8,149

Version

2.0.0

License

MIT

Unpacked Size

4.11 kB

Total Files

7

Last publish

Collaborators

  • mafintosh