Socket
Socket
Sign inDemoInstall

adler-32

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adler-32 - npm Package Compare versions

Comparing version 0.4.0 to 1.0.0

README.md

20

adler32.js

@@ -24,12 +24,10 @@ /* adler32.js (C) 2014-present SheetJS -- http://sheetjs.com */

}(function(ADLER32) {
ADLER32.version = '0.4.0';
/*global Buffer */
var use_buffer = typeof Buffer !== 'undefined';
function adler32_bstr(bstr) {
if(bstr.length > 32768) if(use_buffer) return adler32_buf(new Buffer(bstr));
ADLER32.version = '1.0.0';
function adler32_bstr(bstr, seed) {
var a = 1, b = 0, L = bstr.length, M = 0;
if(typeof seed === 'number') { a = seed & 0xFFFF; b = seed >>> 16; }
for(var i = 0; i < L;) {
M = Math.min(L-i, 3850)+i;
for(;i<M;i++) {
a += bstr.charCodeAt(i);
a += bstr.charCodeAt(i)&0xFF;
b += a;

@@ -43,8 +41,9 @@ }

function adler32_buf(buf) {
function adler32_buf(buf, seed) {
var a = 1, b = 0, L = buf.length, M = 0;
if(typeof seed === 'number') { a = seed & 0xFFFF; b = (seed >>> 16) & 0xFFFF; }
for(var i = 0; i < L;) {
M = Math.min(L-i, 3850)+i;
for(;i<M;i++) {
a += buf[i];
a += buf[i]&0xFF;
b += a;

@@ -58,4 +57,5 @@ }

function adler32_str(str) {
function adler32_str(str, seed) {
var a = 1, b = 0, L = str.length, M = 0, c = 0, d = 0;
if(typeof seed === 'number') { a = seed & 0xFFFF; b = seed >>> 16; }
for(var i = 0; i < L;) {

@@ -85,3 +85,3 @@ M = Math.min(L-i, 3850);

}
return (b << 16) | a;
return ((b%65521) << 16) | (a%65521);
}

@@ -88,0 +88,0 @@ ADLER32.bstr = adler32_bstr;

{
"name": "adler-32",
"version": "0.4.0",
"version": "1.0.0",
"author": "sheetjs",

@@ -13,2 +13,3 @@ "description": "Pure-JS ADLER-32",

"concat-stream":"",
"printj":"",
"exit-on-epipe":""

@@ -18,3 +19,2 @@ },

"mocha":"",
"xlsjs":"",
"codepage":""

@@ -21,0 +21,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc