UNPKG

5.86 kBJavaScriptView Raw
1module.exports = {
2 /* The local file header */
3 LOCHDR : 30, // LOC header size
4 LOCSIG : 0x04034b50, // "PK\003\004"
5 LOCVER : 4, // version needed to extract
6 LOCFLG : 6, // general purpose bit flag
7 LOCHOW : 8, // compression method
8 LOCTIM : 10, // modification time (2 bytes time, 2 bytes date)
9 LOCCRC : 14, // uncompressed file crc-32 value
10 LOCSIZ : 18, // compressed size
11 LOCLEN : 22, // uncompressed size
12 LOCNAM : 26, // filename length
13 LOCEXT : 28, // extra field length
14
15 /* The Data descriptor */
16 EXTSIG : 0x08074b50, // "PK\007\008"
17 EXTHDR : 16, // EXT header size
18 EXTCRC : 4, // uncompressed file crc-32 value
19 EXTSIZ : 8, // compressed size
20 EXTLEN : 12, // uncompressed size
21
22 /* The central directory file header */
23 CENHDR : 46, // CEN header size
24 CENSIG : 0x02014b50, // "PK\001\002"
25 CENVEM : 4, // version made by
26 CENVER : 6, // version needed to extract
27 CENFLG : 8, // encrypt, decrypt flags
28 CENHOW : 10, // compression method
29 CENTIM : 12, // modification time (2 bytes time, 2 bytes date)
30 CENCRC : 16, // uncompressed file crc-32 value
31 CENSIZ : 20, // compressed size
32 CENLEN : 24, // uncompressed size
33 CENNAM : 28, // filename length
34 CENEXT : 30, // extra field length
35 CENCOM : 32, // file comment length
36 CENDSK : 34, // volume number start
37 CENATT : 36, // internal file attributes
38 CENATX : 38, // external file attributes (host system dependent)
39 CENOFF : 42, // LOC header offset
40
41 /* The entries in the end of central directory */
42 ENDHDR : 22, // END header size
43 ENDSIG : 0x06054b50, // "PK\005\006"
44 ENDSUB : 8, // number of entries on this disk
45 ENDTOT : 10, // total number of entries
46 ENDSIZ : 12, // central directory size in bytes
47 ENDOFF : 16, // offset of first CEN header
48 ENDCOM : 20, // zip file comment length
49
50 END64HDR : 20, // zip64 END header size
51 END64SIG : 0x07064b50, // zip64 Locator signature, "PK\006\007"
52 END64START : 4, // number of the disk with the start of the zip64
53 END64OFF : 8, // relative offset of the zip64 end of central directory
54 END64NUMDISKS : 16, // total number of disks
55
56 ZIP64SIG : 0x06064b50, // zip64 signature, "PK\006\006"
57 ZIP64HDR : 56, // zip64 record minimum size
58 ZIP64LEAD : 12, // leading bytes at the start of the record, not counted by the value stored in ZIP64SIZE
59 ZIP64SIZE : 4, // zip64 size of the central directory record
60 ZIP64VEM : 12, // zip64 version made by
61 ZIP64VER : 14, // zip64 version needed to extract
62 ZIP64DSK : 16, // zip64 number of this disk
63 ZIP64DSKDIR : 20, // number of the disk with the start of the record directory
64 ZIP64SUB : 24, // number of entries on this disk
65 ZIP64TOT : 32, // total number of entries
66 ZIP64SIZB : 40, // zip64 central directory size in bytes
67 ZIP64OFF : 48, // offset of start of central directory with respect to the starting disk number
68 ZIP64EXTRA : 56, // extensible data sector
69
70 /* Compression methods */
71 STORED : 0, // no compression
72 SHRUNK : 1, // shrunk
73 REDUCED1 : 2, // reduced with compression factor 1
74 REDUCED2 : 3, // reduced with compression factor 2
75 REDUCED3 : 4, // reduced with compression factor 3
76 REDUCED4 : 5, // reduced with compression factor 4
77 IMPLODED : 6, // imploded
78 // 7 reserved
79 DEFLATED : 8, // deflated
80 ENHANCED_DEFLATED: 9, // enhanced deflated
81 PKWARE : 10,// PKWare DCL imploded
82 // 11 reserved
83 BZIP2 : 12, // compressed using BZIP2
84 // 13 reserved
85 LZMA : 14, // LZMA
86 // 15-17 reserved
87 IBM_TERSE : 18, // compressed using IBM TERSE
88 IBM_LZ77 : 19, //IBM LZ77 z
89
90 /* General purpose bit flag */
91 FLG_ENC : 0, // encripted file
92 FLG_COMP1 : 1, // compression option
93 FLG_COMP2 : 2, // compression option
94 FLG_DESC : 4, // data descriptor
95 FLG_ENH : 8, // enhanced deflation
96 FLG_STR : 16, // strong encryption
97 FLG_LNG : 1024, // language encoding
98 FLG_MSK : 4096, // mask header values
99
100 /* Load type */
101 FILE : 2,
102 BUFFER : 1,
103 NONE : 0,
104
105 /* 4.5 Extensible data fields */
106 EF_ID : 0,
107 EF_SIZE : 2,
108
109 /* Header IDs */
110 ID_ZIP64 : 0x0001,
111 ID_AVINFO : 0x0007,
112 ID_PFS : 0x0008,
113 ID_OS2 : 0x0009,
114 ID_NTFS : 0x000a,
115 ID_OPENVMS : 0x000c,
116 ID_UNIX : 0x000d,
117 ID_FORK : 0x000e,
118 ID_PATCH : 0x000f,
119 ID_X509_PKCS7 : 0x0014,
120 ID_X509_CERTID_F : 0x0015,
121 ID_X509_CERTID_C : 0x0016,
122 ID_STRONGENC : 0x0017,
123 ID_RECORD_MGT : 0x0018,
124 ID_X509_PKCS7_RL : 0x0019,
125 ID_IBM1 : 0x0065,
126 ID_IBM2 : 0x0066,
127 ID_POSZIP : 0x4690,
128
129 EF_ZIP64_OR_32 : 0xffffffff,
130 EF_ZIP64_OR_16 : 0xffff,
131 EF_ZIP64_SUNCOMP : 0,
132 EF_ZIP64_SCOMP : 8,
133 EF_ZIP64_RHO : 16,
134 EF_ZIP64_DSN : 24
135};