Skip to content

Commit

Permalink
Deflate needs min V2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
5saviahv committed Nov 19, 2020
1 parent dde4f51 commit bc0f594
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions headers/entryHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var Utils = require("../util"),

/* The central directory file header */
module.exports = function () {
var _verMade = 0x0A,
var _verMade = 0x14,
_version = 0x0A,
_flags = 0,
_method = 0,
Expand All @@ -20,6 +20,15 @@ module.exports = function () {
_attr = 0,
_offset = 0;

switch(process.platform){
case 'win32':
_verMade |= 0x0A00;
case 'darwin':
_verMade |= 0x1300;
default:
_verMade |= 0x0300;
}

var _dataHeader = {};

function setTime(val) {
Expand Down Expand Up @@ -47,7 +56,16 @@ module.exports = function () {
set flags (val) { _flags = val; },

get method () { return _method; },
set method (val) { _method = val; },
set method (val) {
switch (val){
case Constants.STORED:
this.version = 10;
case Constants.DEFLATED:
default:
this.version = 20;
}
_method = val;
},

get time () { return new Date(
((_time >> 25) & 0x7f) + 1980,
Expand Down

0 comments on commit bc0f594

Please sign in to comment.