asy-diff
v0.0.12
Published
This is an async version for fast-diff
Downloads
3
Readme
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