Socket
Socket
Sign inDemoInstall

adler-32

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.1 to 0.3.0

54

adler32.js

@@ -1,6 +0,22 @@

/* adler32.js (C) 2014 SheetJS -- http://sheetjs.com */
/* adler32.js (C) 2014-present SheetJS -- http://sheetjs.com */
/* vim: set ts=2: */
var ADLER32 = {};
(function(ADLER32) {
ADLER32.version = '0.2.0';
var ADLER32;
(function (factory) {
if(typeof DO_NOT_EXPORT_ADLER === 'undefined') {
if('object' === typeof exports) {
factory(exports);
} else if ('function' === typeof define && define.amd) {
define(function () {
var module = {};
factory(module);
return module;
});
} else {
factory(ADLER32 = {});
}
} else {
factory(ADLER32 = {});
}
}(function(ADLER32) {
ADLER32.version = '0.3.0';
/* consult README.md for the magic number */

@@ -10,3 +26,3 @@ /* charCodeAt is the best approach for binary strings */

function adler32_bstr(bstr) {
if(bstr.length > 32768) if(use_buffer) return adler32_buf(Buffer(bstr));
if(bstr.length > 32768) if(use_buffer) return adler32_buf(new Buffer(bstr));
var a = 1, b = 0, L = bstr.length, M;

@@ -19,4 +35,4 @@ for(var i = 0; i < L;) {

}
a = (15*(a>>>16)+(a&65535))
b = (15*(b>>>16)+(b&65535))
a = (15*(a>>>16)+(a&65535));
b = (15*(b>>>16)+(b&65535));
}

@@ -34,4 +50,4 @@ return ((b%65521) << 16) | (a%65521);

}
a = (15*(a>>>16)+(a&65535))
b = (15*(b>>>16)+(b&65535))
a = (15*(a>>>16)+(a&65535));
b = (15*(b>>>16)+(b&65535));
}

@@ -50,14 +66,14 @@ return ((b%65521) << 16) | (a%65521);

else if(c < 0x800) {
a += 192|((c>>6)&31); b += a; --M;
a += 128|(c&63); b += a; --M;
a += 192|((c>>6)&31); b += a; --M;
a += 128|(c&63); b += a; --M;
} else if(c >= 0xD800 && c < 0xE000) {
c = (c&1023)+64; d = str.charCodeAt(i++) & 1023;
a += 240|((c>>8)&7); b += a; --M;
a += 128|((c>>2)&63); b += a; --M;
a += 128|((d>>6)&15)|(c&3); b += a; --M;
a += 128|(d&63); b += a; --M;
a += 240|((c>>8)&7); b += a; --M;
a += 128|((c>>2)&63); b += a; --M;
a += 128|((d>>6)&15)|((c&3)<<4); b += a; --M;
a += 128|(d&63); b += a; --M;
} else {
a += 224|((c>>12)&15); b += a; --M;
a += 128|((c>>6)&63); b += a; --M;
a += 128|(c&63); b += a; --M;
a += 224|((c>>12)&15); b += a; --M;
a += 128|((c>>6)&63); b += a; --M;
a += 128|(c&63); b += a; --M;
}

@@ -73,2 +89,2 @@ }

ADLER32.str = adler32_str;
})(typeof exports !== "undefined" && typeof DO_NOT_EXPORT_ADLER === 'undefined' ? exports : ADLER32);
}));
{
"name": "adler-32",
"version": "0.2.1",
"version": "0.3.0",
"author": "sheetjs",

@@ -5,0 +5,0 @@ "description": "Pure-JS ADLER-32",

@@ -82,2 +82,4 @@ # adler32

## Badges
[![Build Status](https://travis-ci.org/SheetJS/js-adler32.svg?branch=master)](https://travis-ci.org/SheetJS/js-adler32)

@@ -87,3 +89,3 @@

[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/8827aa40b3fdbca7c7ad0f51c68b3379 "githalytics.com")](http://githalytics.com/SheetJS/js-adler32)
[![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/js-adler32?pixel)](https://github.com/SheetJS/js-adler32)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc