node-stream-zip
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -142,7 +142,3 @@ /** | ||
EF_ZIP64_OR_32 : 0xffffffff, | ||
EF_ZIP64_OR_16 : 0xffff, | ||
EF_ZIP64_SUNCOMP : 0, | ||
EF_ZIP64_SCOMP : 8, | ||
EF_ZIP64_RHO : 16, | ||
EF_ZIP64_DSN : 24 | ||
EF_ZIP64_OR_16 : 0xffff | ||
}; | ||
@@ -244,4 +240,4 @@ | ||
that.centralDirectory = centralDirectory; | ||
if (centralDirectory.volumeEntries === 0xffff && centralDirectory.totalEntries === 0xffff | ||
|| centralDirectory.size === 0xffffffff || centralDirectory.offset === 0xffffffff) { | ||
if (centralDirectory.volumeEntries === consts.EF_ZIP64_OR_16 && centralDirectory.totalEntries === consts.EF_ZIP64_OR_16 | ||
|| centralDirectory.size === consts.EF_ZIP64_OR_32 || centralDirectory.offset === consts.EF_ZIP64_OR_32) { | ||
readZip64CentralDirectoryLocator(); | ||
@@ -734,10 +730,18 @@ } else { | ||
ZipEntry.prototype.parseZip64Extra = function(data, offset, length) { | ||
if (length >= consts.EF_ZIP64_SCOMP && this.size === consts.EF_ZIP64_OR_32) | ||
this.size = Util.readUInt64LE(data, offset + consts.EF_ZIP64_SUNCOMP); | ||
if (length >= consts.EF_ZIP64_RHO && this.compressedSize === consts.EF_ZIP64_OR_32) | ||
this.compressedSize = Util.readUInt64LE(data, offset + consts.EF_ZIP64_SCOMP); | ||
if (length >= consts.EF_ZIP64_DSN && this.offset === consts.EF_ZIP64_OR_32) | ||
this.offset = Util.readUInt64LE(data, offset + consts.EF_ZIP64_RHO); | ||
if (length >= consts.EF_ZIP64_DSN + 4 && this.diskStart === consts.EF_ZIP64_OR_16) | ||
this.diskStart = data.readUInt32LE(consts.EF_ZIP64_DSN); | ||
if (length >= 8 && this.size === consts.EF_ZIP64_OR_32) { | ||
this.size = Util.readUInt64LE(data, offset); | ||
offset += 8; length -= 8; | ||
} | ||
if (length >= 8 && this.compressedSize === consts.EF_ZIP64_OR_32) { | ||
this.compressedSize = Util.readUInt64LE(data, offset); | ||
offset += 8; length -= 8; | ||
} | ||
if (length >= 8 && this.offset === consts.EF_ZIP64_OR_32) { | ||
this.offset = Util.readUInt64LE(data, offset); | ||
offset += 8; length -= 8; | ||
} | ||
if (length >= 4 && this.diskStart === consts.EF_ZIP64_OR_16) { | ||
this.diskStart = data.readUInt32LE(offset); | ||
// offset += 4; length -= 4; | ||
} | ||
}; | ||
@@ -966,3 +970,3 @@ | ||
readUInt64LE: function(buffer, offset) { | ||
return (buffer.readUInt32LE(offset + 4) << 4) + buffer.readUInt32LE(offset); | ||
return (buffer.readUInt32LE(offset + 4) * 0x0000000100000000) + buffer.readUInt32LE(offset); | ||
} | ||
@@ -969,0 +973,0 @@ }; |
{ | ||
"name": "node-stream-zip", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "node.js library for reading and extraction of ZIP archives", | ||
@@ -32,3 +32,5 @@ "keywords": [ | ||
}, | ||
"devDependencies": {} | ||
"devDependencies": { | ||
"nodeunit": "^0.9.1" | ||
} | ||
} |
872
36819
1