0.0.12 • Published 7 years ago

asy-diff v0.0.12

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

Async diff

This is an async version for fast-diff. It runs diff function in another thread but not in main. Webpack should be installed if you want to re-compile fast-diff which is the core algorithm.

The diff function is an implementation of "An O(ND) Difference Algorithm and its Variations" (Myers, 1986) with the suggested divide and conquer strategy along with several optimizations Neil added.

'use strict';

const co = require('co');
const Thread = require('asy-diff').Thread;
const randomstring = require('randomstring');

var thread = new Thread();

co(function *(){
  for(;;) {
    var good = randomstring.generate(1000);
    var bad = randomstring.generate(1000);
    var r = yield thread.fastDiff(new Buffer(good), new Buffer(bad));
    console.log(r.toString());
  }
});

证书 (License)

Apache-2.0

0.0.12

7 years ago

0.0.10

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.4

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago