Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
a += 224|((c>>12)&15); b += a; --M;
a += 128|((c>>6)&63); b += a; --M;
a += 128|(c&63); b += a; --M;
}
}
a %= 65521;
b %= 65521;
}
return (b << 16) | a;
}
var foobar = "foo bar baz٪☃🍣";
for(var i = 0; i != 11; ++i) foobar += " " + foobar;
var assert = require('assert');
var res = old(foobar);
assert.equal(res, cur(foobar));
assert.equal(res, sheetjs1(foobar));
assert.equal(res, sheetjs2(foobar));
var BM = require('./bm');
var suite = new BM('unicode string');
suite.add('sheetjs 1', function() { for(var j = 0; j != 1000; ++j) sheetjs1(foobar); });
suite.add('sheetjs 2', function() { for(var j = 0; j != 1000; ++j) sheetjs2(foobar); });
suite.add('last vers', function() { for(var j = 0; j != 1000; ++j) old(foobar); });
suite.add('current v', function() { for(var j = 0; j != 1000; ++j) cur(foobar); });
suite.run();
export default function checksum(lines: Array): string {
const saltedContent = [...DEFAULT_CONTENT, ...lines].join("");
return `${adler32.str(saltedContent)}`.replace("-", "");
}
suite.add('last vers', function() { for(var j = 0; j != 1000; ++j) old(foobar); });
suite.add('current v', function() { for(var j = 0; j != 1000; ++j) cur(foobar); });
suite.add('last vers', function() { for(var j = 0; j != m; ++j) old(foobar); });
suite.add('current v', function() { for(var j = 0; j != m; ++j) cur(foobar); });
}
var w = 6;
var foobar = [255,255,255,255,255,255].map(function(x) { return String.fromCharCode(x); }).join("");
for(var ff = 0; ff < w; ++ff) foobar += foobar;
foobar.charCodeAt(0);
var m = 2048;
var assert = require('assert');
var BM = require('./bm');
for(var i = 0; i != 6; ++i) foobar += foobar;
for(var i = 6; i != 14; ++i) {
foobar += foobar;
foobar.charCodeAt(0);
var res = old(foobar);
assert.equal(res, cur(foobar));
assert.equal(res, sheetjs1(foobar));
assert.equal(res, sheetjs2(foobar));
assert.equal(res, sheetjs3(foobar));
var suite = new BM('binary string (' + foobar.length + ')');
if(i<3) suite.add('sheetjs 1', function() { for(var j = 0; j != m; ++j) sheetjs1(foobar); });
suite.add('sheetjs 2', function() { for(var j = 0; j != m; ++j) sheetjs2(foobar); });
suite.add('sheetjs 3', function() { for(var j = 0; j != m; ++j) sheetjs3(foobar); });
suite.add('last vers', function() { for(var j = 0; j != m; ++j) old(foobar); });
suite.add('current v', function() { for(var j = 0; j != m; ++j) cur(foobar); });
suite.run();
m>>>=1; if(m < 10) m = 10;
}