How to use the adler-32.str function in adler-32

To help you get started, we’ve selected a few adler-32 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SheetJS / js-adler32 / perf / utf8.js View on Github external
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();
github somewhatabstract / checksync / src / checksum.js View on Github external
export default function checksum(lines: Array): string {
    const saltedContent = [...DEFAULT_CONTENT, ...lines].join("");
    return `${adler32.str(saltedContent)}`.replace("-", "");
}
github SheetJS / js-adler32 / perf / utf8.js View on Github external
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); });

adler-32

Pure-JS ADLER-32

Apache-2.0
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis

Popular adler-32 functions