xor-distance
Calculate the distance between two buffers as a new buffer and compare computed distances with eachother
Last updated 6 years ago by mafintosh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install xor-distance 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.0                                ...           latest (6 years ago)

2 Versions

  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Total 1
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE