@novnc/novnc 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/base64.js +104 -0
- package/core/crypto/aes.js +178 -0
- package/core/crypto/bigint.js +34 -0
- package/core/crypto/crypto.js +90 -0
- package/core/crypto/des.js +330 -0
- package/core/crypto/dh.js +55 -0
- package/core/crypto/md5.js +82 -0
- package/core/crypto/rsa.js +132 -0
- package/core/decoders/copyrect.js +27 -0
- package/core/decoders/h264.js +321 -0
- package/core/decoders/hextile.js +181 -0
- package/core/decoders/jpeg.js +161 -0
- package/core/decoders/raw.js +59 -0
- package/core/decoders/rre.js +44 -0
- package/core/decoders/tight.js +393 -0
- package/core/decoders/tightpng.js +27 -0
- package/core/decoders/zlib.js +51 -0
- package/core/decoders/zrle.js +185 -0
- package/core/deflator.js +84 -0
- package/core/display.js +578 -0
- package/core/encodings.js +54 -0
- package/core/inflator.js +65 -0
- package/core/input/domkeytable.js +311 -0
- package/core/input/fixedkeys.js +129 -0
- package/core/input/gesturehandler.js +567 -0
- package/core/input/keyboard.js +294 -0
- package/core/input/keysym.js +616 -0
- package/core/input/keysymdef.js +688 -0
- package/core/input/util.js +191 -0
- package/core/input/vkeys.js +116 -0
- package/core/input/xtscancodes.js +173 -0
- package/core/ra2.js +312 -0
- package/core/rfb.js +3411 -0
- package/core/util/browser.js +233 -0
- package/core/util/cursor.js +249 -0
- package/core/util/element.js +32 -0
- package/core/util/events.js +138 -0
- package/core/util/eventtarget.js +35 -0
- package/core/util/int.js +15 -0
- package/core/util/logging.js +56 -0
- package/core/util/strings.js +28 -0
- package/core/websock.js +369 -0
- package/docs/API.md +0 -5
- package/package.json +6 -10
- package/vendor/pako/LICENSE +21 -0
- package/vendor/pako/README.md +6 -0
- package/{lib/vendor → vendor}/pako/lib/utils/common.js +13 -23
- package/{lib/vendor → vendor}/pako/lib/zlib/adler32.js +12 -14
- package/vendor/pako/lib/zlib/constants.js +47 -0
- package/{lib/vendor → vendor}/pako/lib/zlib/crc32.js +15 -14
- package/{lib/vendor → vendor}/pako/lib/zlib/deflate.js +459 -334
- package/{lib/vendor → vendor}/pako/lib/zlib/gzheader.js +13 -19
- package/{lib/vendor → vendor}/pako/lib/zlib/inffast.js +116 -119
- package/vendor/pako/lib/zlib/inflate.js +1527 -0
- package/{lib/vendor → vendor}/pako/lib/zlib/inftrees.js +103 -91
- package/vendor/pako/lib/zlib/messages.js +11 -0
- package/{lib/vendor → vendor}/pako/lib/zlib/trees.js +313 -268
- package/{lib/vendor → vendor}/pako/lib/zlib/zstream.js +4 -10
- package/lib/base64.js +0 -100
- package/lib/crypto/aes.js +0 -481
- package/lib/crypto/bigint.js +0 -41
- package/lib/crypto/crypto.js +0 -109
- package/lib/crypto/des.js +0 -374
- package/lib/crypto/dh.js +0 -81
- package/lib/crypto/md5.js +0 -97
- package/lib/crypto/rsa.js +0 -312
- package/lib/decoders/copyrect.js +0 -40
- package/lib/decoders/h264.js +0 -349
- package/lib/decoders/hextile.js +0 -195
- package/lib/decoders/jpeg.js +0 -175
- package/lib/decoders/raw.js +0 -66
- package/lib/decoders/rre.js +0 -52
- package/lib/decoders/tight.js +0 -363
- package/lib/decoders/tightpng.js +0 -51
- package/lib/decoders/zlib.js +0 -57
- package/lib/decoders/zrle.js +0 -192
- package/lib/deflator.js +0 -88
- package/lib/display.js +0 -588
- package/lib/encodings.js +0 -70
- package/lib/inflator.js +0 -77
- package/lib/input/domkeytable.js +0 -313
- package/lib/input/fixedkeys.js +0 -127
- package/lib/input/gesturehandler.js +0 -573
- package/lib/input/keyboard.js +0 -293
- package/lib/input/keysym.js +0 -878
- package/lib/input/keysymdef.js +0 -1351
- package/lib/input/util.js +0 -217
- package/lib/input/vkeys.js +0 -121
- package/lib/input/xtscancodes.js +0 -343
- package/lib/ra2.js +0 -535
- package/lib/rfb.js +0 -3398
- package/lib/util/browser.js +0 -239
- package/lib/util/cursor.js +0 -269
- package/lib/util/element.js +0 -41
- package/lib/util/events.js +0 -133
- package/lib/util/eventtarget.js +0 -53
- package/lib/util/int.js +0 -21
- package/lib/util/logging.js +0 -56
- package/lib/util/strings.js +0 -36
- package/lib/vendor/pako/lib/zlib/constants.js +0 -47
- package/lib/vendor/pako/lib/zlib/inflate.js +0 -1602
- package/lib/vendor/pako/lib/zlib/messages.js +0 -25
- package/lib/websock.js +0 -395
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = inflate_table;
|
|
8
|
-
var utils = _interopRequireWildcard(require("../utils/common.js"));
|
|
9
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
1
|
+
import * as utils from "../utils/common.js";
|
|
2
|
+
|
|
11
3
|
var MAXBITS = 15;
|
|
12
4
|
var ENOUGH_LENS = 852;
|
|
13
5
|
var ENOUGH_DISTS = 592;
|
|
@@ -16,41 +8,57 @@ var ENOUGH_DISTS = 592;
|
|
|
16
8
|
var CODES = 0;
|
|
17
9
|
var LENS = 1;
|
|
18
10
|
var DISTS = 2;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
16, 16, 16, 16,
|
|
27
|
-
|
|
11
|
+
|
|
12
|
+
var lbase = [ /* Length codes 257..285 base */
|
|
13
|
+
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
|
|
14
|
+
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
var lext = [ /* Length codes 257..285 extra */
|
|
18
|
+
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
|
|
19
|
+
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
var dbase = [ /* Distance codes 0..29 base */
|
|
23
|
+
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
|
24
|
+
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
|
25
|
+
8193, 12289, 16385, 24577, 0, 0
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
var dext = [ /* Distance codes 0..29 extra */
|
|
29
|
+
16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
|
|
30
|
+
23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
|
|
31
|
+
28, 28, 29, 29, 64, 64
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export default function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
|
|
35
|
+
{
|
|
28
36
|
var bits = opts.bits;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var len = 0;
|
|
32
|
-
var sym = 0;
|
|
33
|
-
var min = 0,
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var base = null; /* base value table to use */
|
|
37
|
+
//here = opts.here; /* table entry for duplication */
|
|
38
|
+
|
|
39
|
+
var len = 0; /* a code's length in bits */
|
|
40
|
+
var sym = 0; /* index of code symbols */
|
|
41
|
+
var min = 0, max = 0; /* minimum and maximum code lengths */
|
|
42
|
+
var root = 0; /* number of index bits for root table */
|
|
43
|
+
var curr = 0; /* number of index bits for current table */
|
|
44
|
+
var drop = 0; /* code bits to drop for sub-table */
|
|
45
|
+
var left = 0; /* number of prefix codes available */
|
|
46
|
+
var used = 0; /* code entries in table used */
|
|
47
|
+
var huff = 0; /* Huffman code */
|
|
48
|
+
var incr; /* for incrementing code, index */
|
|
49
|
+
var fill; /* index for replicating entries */
|
|
50
|
+
var low; /* low bits for current root entry */
|
|
51
|
+
var mask; /* mask for low root bits */
|
|
52
|
+
var next; /* next available space in table */
|
|
53
|
+
var base = null; /* base value table to use */
|
|
47
54
|
var base_index = 0;
|
|
48
|
-
|
|
49
|
-
var end;
|
|
55
|
+
// var shoextra; /* extra bits table to use */
|
|
56
|
+
var end; /* use base and extra for symbol > end */
|
|
50
57
|
var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */
|
|
51
58
|
var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */
|
|
52
59
|
var extra = null;
|
|
53
60
|
var extra_index = 0;
|
|
61
|
+
|
|
54
62
|
var here_bits, here_op, here_val;
|
|
55
63
|
|
|
56
64
|
/*
|
|
@@ -65,16 +73,19 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
65
73
|
from their more natural integer increment ordering, and so when the
|
|
66
74
|
decoding tables are built in the large loop below, the integer codes
|
|
67
75
|
are incremented backwards.
|
|
68
|
-
|
|
76
|
+
|
|
77
|
+
This routine assumes, but does not check, that all of the entries in
|
|
69
78
|
lens[] are in the range 0..MAXBITS. The caller must assure this.
|
|
70
79
|
1..MAXBITS is interpreted as that code length. zero means that that
|
|
71
80
|
symbol does not occur in this code.
|
|
72
|
-
|
|
81
|
+
|
|
82
|
+
The codes are sorted by computing a count of codes for each length,
|
|
73
83
|
creating from that a table of starting indices for each length in the
|
|
74
84
|
sorted table, and then entering the symbols in order in the sorted
|
|
75
85
|
table. The sorted table is work[], with that space being provided by
|
|
76
86
|
the caller.
|
|
77
|
-
|
|
87
|
+
|
|
88
|
+
The length counts are used for other purposes as well, i.e. finding
|
|
78
89
|
the minimum and maximum length codes, determining if there are any
|
|
79
90
|
codes at all, checking for a valid set of lengths, and looking ahead
|
|
80
91
|
at length counts to determine sub-table sizes when building the
|
|
@@ -92,31 +103,28 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
92
103
|
/* bound code lengths, force root to be within code lengths */
|
|
93
104
|
root = bits;
|
|
94
105
|
for (max = MAXBITS; max >= 1; max--) {
|
|
95
|
-
if (count[max] !== 0) {
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
106
|
+
if (count[max] !== 0) { break; }
|
|
98
107
|
}
|
|
99
108
|
if (root > max) {
|
|
100
109
|
root = max;
|
|
101
110
|
}
|
|
102
|
-
if (max === 0) {
|
|
103
|
-
/* no symbols to code at all */
|
|
111
|
+
if (max === 0) { /* no symbols to code at all */
|
|
104
112
|
//table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
|
|
105
113
|
//table.bits[opts.table_index] = 1; //here.bits = (var char)1;
|
|
106
114
|
//table.val[opts.table_index++] = 0; //here.val = (var short)0;
|
|
107
|
-
table[table_index++] = 1 << 24 | 64 << 16 | 0;
|
|
115
|
+
table[table_index++] = (1 << 24) | (64 << 16) | 0;
|
|
116
|
+
|
|
108
117
|
|
|
109
118
|
//table.op[opts.table_index] = 64;
|
|
110
119
|
//table.bits[opts.table_index] = 1;
|
|
111
120
|
//table.val[opts.table_index++] = 0;
|
|
112
|
-
table[table_index++] = 1 << 24 | 64 << 16 | 0;
|
|
121
|
+
table[table_index++] = (1 << 24) | (64 << 16) | 0;
|
|
122
|
+
|
|
113
123
|
opts.bits = 1;
|
|
114
|
-
return 0;
|
|
124
|
+
return 0; /* no symbols, but wait for decoding to report error */
|
|
115
125
|
}
|
|
116
126
|
for (min = 1; min < max; min++) {
|
|
117
|
-
if (count[min] !== 0) {
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
127
|
+
if (count[min] !== 0) { break; }
|
|
120
128
|
}
|
|
121
129
|
if (root < min) {
|
|
122
130
|
root = min;
|
|
@@ -129,10 +137,10 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
129
137
|
left -= count[len];
|
|
130
138
|
if (left < 0) {
|
|
131
139
|
return -1;
|
|
132
|
-
}
|
|
140
|
+
} /* over-subscribed */
|
|
133
141
|
}
|
|
134
142
|
if (left > 0 && (type === CODES || max !== 1)) {
|
|
135
|
-
return -1;
|
|
143
|
+
return -1; /* incomplete set */
|
|
136
144
|
}
|
|
137
145
|
|
|
138
146
|
/* generate offsets into symbol table for each length for sorting */
|
|
@@ -155,21 +163,25 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
155
163
|
bits off of the bottom. For codes where len is less than drop + curr,
|
|
156
164
|
those top drop + curr - len bits are incremented through all values to
|
|
157
165
|
fill the table with replicated entries.
|
|
158
|
-
|
|
166
|
+
|
|
167
|
+
root is the number of index bits for the root table. When len exceeds
|
|
159
168
|
root, sub-tables are created pointed to by the root entry with an index
|
|
160
169
|
of the low root bits of huff. This is saved in low to check for when a
|
|
161
170
|
new sub-table should be started. drop is zero when the root table is
|
|
162
171
|
being filled, and drop is root when sub-tables are being filled.
|
|
163
|
-
|
|
172
|
+
|
|
173
|
+
When a new sub-table is needed, it is necessary to look ahead in the
|
|
164
174
|
code lengths to determine what size sub-table is needed. The length
|
|
165
175
|
counts are used for this, and so count[] is decremented as codes are
|
|
166
176
|
entered in the tables.
|
|
167
|
-
|
|
177
|
+
|
|
178
|
+
used keeps track of how many table entries have been allocated from the
|
|
168
179
|
provided *table space. It is checked for LENS and DIST tables against
|
|
169
180
|
the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
|
|
170
181
|
the initial root table size constants. See the comments in inftrees.h
|
|
171
182
|
for more information.
|
|
172
|
-
|
|
183
|
+
|
|
184
|
+
sym increments through all symbols, and the loop terminates when
|
|
173
185
|
all codes of length max, i.e. all codes, have been processed. This
|
|
174
186
|
routine permits incomplete codes, so another loop after this one fills
|
|
175
187
|
in the rest of the decoding tables with invalid code markers.
|
|
@@ -179,34 +191,36 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
179
191
|
// poor man optimization - use if-else instead of switch,
|
|
180
192
|
// to avoid deopts in old v8
|
|
181
193
|
if (type === CODES) {
|
|
182
|
-
base = extra = work;
|
|
194
|
+
base = extra = work; /* dummy value--not used */
|
|
183
195
|
end = 19;
|
|
196
|
+
|
|
184
197
|
} else if (type === LENS) {
|
|
185
198
|
base = lbase;
|
|
186
199
|
base_index -= 257;
|
|
187
200
|
extra = lext;
|
|
188
201
|
extra_index -= 257;
|
|
189
202
|
end = 256;
|
|
190
|
-
|
|
191
|
-
|
|
203
|
+
|
|
204
|
+
} else { /* DISTS */
|
|
192
205
|
base = dbase;
|
|
193
206
|
extra = dext;
|
|
194
207
|
end = -1;
|
|
195
208
|
}
|
|
196
209
|
|
|
197
210
|
/* initialize opts for loop */
|
|
198
|
-
huff = 0;
|
|
199
|
-
sym = 0;
|
|
200
|
-
len = min;
|
|
201
|
-
next = table_index;
|
|
202
|
-
curr = root;
|
|
203
|
-
drop = 0;
|
|
204
|
-
low = -1;
|
|
205
|
-
used = 1 << root;
|
|
206
|
-
mask = used - 1;
|
|
211
|
+
huff = 0; /* starting code */
|
|
212
|
+
sym = 0; /* starting code symbol */
|
|
213
|
+
len = min; /* starting code length */
|
|
214
|
+
next = table_index; /* current table to fill in */
|
|
215
|
+
curr = root; /* current table index bits */
|
|
216
|
+
drop = 0; /* current bits to drop from code for index */
|
|
217
|
+
low = -1; /* trigger new sub-table when len > root */
|
|
218
|
+
used = 1 << root; /* use root table entries */
|
|
219
|
+
mask = used - 1; /* mask for comparing low */
|
|
207
220
|
|
|
208
221
|
/* check available table space */
|
|
209
|
-
if (type === LENS && used > ENOUGH_LENS ||
|
|
222
|
+
if ((type === LENS && used > ENOUGH_LENS) ||
|
|
223
|
+
(type === DISTS && used > ENOUGH_DISTS)) {
|
|
210
224
|
return 1;
|
|
211
225
|
}
|
|
212
226
|
|
|
@@ -217,25 +231,27 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
217
231
|
if (work[sym] < end) {
|
|
218
232
|
here_op = 0;
|
|
219
233
|
here_val = work[sym];
|
|
220
|
-
}
|
|
234
|
+
}
|
|
235
|
+
else if (work[sym] > end) {
|
|
221
236
|
here_op = extra[extra_index + work[sym]];
|
|
222
237
|
here_val = base[base_index + work[sym]];
|
|
223
|
-
}
|
|
224
|
-
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
here_op = 32 + 64; /* end of block */
|
|
225
241
|
here_val = 0;
|
|
226
242
|
}
|
|
227
243
|
|
|
228
244
|
/* replicate for those indices with low len bits equal to huff */
|
|
229
|
-
incr = 1 << len - drop;
|
|
245
|
+
incr = 1 << (len - drop);
|
|
230
246
|
fill = 1 << curr;
|
|
231
|
-
min = fill;
|
|
247
|
+
min = fill; /* save offset to next table */
|
|
232
248
|
do {
|
|
233
249
|
fill -= incr;
|
|
234
|
-
table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val |
|
|
250
|
+
table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
|
|
235
251
|
} while (fill !== 0);
|
|
236
252
|
|
|
237
253
|
/* backwards increment the len-bit code huff */
|
|
238
|
-
incr = 1 << len - 1;
|
|
254
|
+
incr = 1 << (len - 1);
|
|
239
255
|
while (huff & incr) {
|
|
240
256
|
incr >>= 1;
|
|
241
257
|
}
|
|
@@ -249,9 +265,7 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
249
265
|
/* go to next symbol, update count, len */
|
|
250
266
|
sym++;
|
|
251
267
|
if (--count[len] === 0) {
|
|
252
|
-
if (len === max) {
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
268
|
+
if (len === max) { break; }
|
|
255
269
|
len = lens[lens_index + work[sym]];
|
|
256
270
|
}
|
|
257
271
|
|
|
@@ -263,23 +277,22 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
263
277
|
}
|
|
264
278
|
|
|
265
279
|
/* increment past last table */
|
|
266
|
-
next += min;
|
|
280
|
+
next += min; /* here min is 1 << curr */
|
|
267
281
|
|
|
268
282
|
/* determine length of next table */
|
|
269
283
|
curr = len - drop;
|
|
270
284
|
left = 1 << curr;
|
|
271
285
|
while (curr + drop < max) {
|
|
272
286
|
left -= count[curr + drop];
|
|
273
|
-
if (left <= 0) {
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
287
|
+
if (left <= 0) { break; }
|
|
276
288
|
curr++;
|
|
277
289
|
left <<= 1;
|
|
278
290
|
}
|
|
279
291
|
|
|
280
292
|
/* check for enough space */
|
|
281
293
|
used += 1 << curr;
|
|
282
|
-
if (type === LENS && used > ENOUGH_LENS ||
|
|
294
|
+
if ((type === LENS && used > ENOUGH_LENS) ||
|
|
295
|
+
(type === DISTS && used > ENOUGH_DISTS)) {
|
|
283
296
|
return 1;
|
|
284
297
|
}
|
|
285
298
|
|
|
@@ -288,7 +301,7 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
288
301
|
/*table.op[low] = curr;
|
|
289
302
|
table.bits[low] = root;
|
|
290
303
|
table.val[low] = next - opts.table_index;*/
|
|
291
|
-
table[low] = root << 24 | curr << 16 | next - table_index |
|
|
304
|
+
table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
|
|
292
305
|
}
|
|
293
306
|
}
|
|
294
307
|
|
|
@@ -299,12 +312,11 @@ function inflate_table(type, lens, lens_index, codes, table, table_index, work,
|
|
|
299
312
|
//table.op[next + huff] = 64; /* invalid code marker */
|
|
300
313
|
//table.bits[next + huff] = len - drop;
|
|
301
314
|
//table.val[next + huff] = 0;
|
|
302
|
-
table[next + huff] = len - drop << 24 | 64 << 16 |
|
|
315
|
+
table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
|
|
303
316
|
}
|
|
304
317
|
|
|
305
318
|
/* set return parameters */
|
|
306
319
|
//opts.table_index += used;
|
|
307
320
|
opts.bits = root;
|
|
308
321
|
return 0;
|
|
309
|
-
}
|
|
310
|
-
;
|
|
322
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
2: 'need dictionary', /* Z_NEED_DICT 2 */
|
|
3
|
+
1: 'stream end', /* Z_STREAM_END 1 */
|
|
4
|
+
0: '', /* Z_OK 0 */
|
|
5
|
+
'-1': 'file error', /* Z_ERRNO (-1) */
|
|
6
|
+
'-2': 'stream error', /* Z_STREAM_ERROR (-2) */
|
|
7
|
+
'-3': 'data error', /* Z_DATA_ERROR (-3) */
|
|
8
|
+
'-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
|
|
9
|
+
'-5': 'buffer error', /* Z_BUF_ERROR (-5) */
|
|
10
|
+
'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
|
|
11
|
+
};
|