|
17 | 17 | # You should have received a copy of the GNU General Public License
|
18 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19 | 19 |
|
20 |
| -# Note: this program is mostly based on the description of Ben Rudiak-Gould in the comp.compression group: |
| 20 | +# Note: this program is mostly based on the description of Ben Rudiak- |
| 21 | +# Gould in the comp.compression group: |
21 | 22 | # https://groups.google.com/forum/#!msg/comp.compression/M5P064or93o/W1ca1-ad6kgJ
|
22 | 23 | # and zlib's blast.c:
|
23 | 24 | # https://github.com/madler/zlib/blob/master/contrib/blast/blast.c#L150
|
24 | 25 |
|
25 |
| -# It should be noted that there is a small mistake in Ben's example. He writes 00 04 82 24 25 c7 80 7f should |
26 |
| -# decompress to 'AIAIAIAIAIAIA'; However, testing this with my implementation failed. I realized that there is |
27 |
| -# a small mistake in the sequence itself, when I created it with the official pkware ziptool (see below for tests) |
28 |
| -# and the sequence turned out to be actually 00 04 82 24 25 8f 80 7f (notice the difference at byte 6). This will |
| 26 | +# It should be noted that there is a small mistake in Ben's example. |
| 27 | +# He uses 00 04 82 24 25 c7 80 7f as example, which should decompress |
| 28 | +# to 'AIAIAIAIAIAIA'. However, testing this with my implementation |
| 29 | +# failed. When I created it with the official pkware ziptool (see |
| 30 | +# below for tests), the sequence turned out to be actually |
| 31 | +# 00 04 82 24 25 8f 80 7f (notice the difference at byte 6). This will |
29 | 32 | # successfully decompress to 'AIAIAIAIAIAIA'.
|
30 | 33 |
|
31 |
| -# Instead of pure dictionaries, this package uses functions to provide the data of the tables necessary to decompress |
32 |
| -# streams. Advantage: functions are 'read-only' and can provide error feedback. Disadvantage: overhead, runtime. But |
33 |
| -# it is considered to be minimal. In order to reduce the extra time a little bit, all tables are 'complete', i.e. each |
34 |
| -# entry just needs to be extracted and does not need to be calculated. The difference is minimal and practical non- |
35 |
| -# existant when accessing a function one time only; but these functions can be called hundred or thousand times per |
36 |
| -# stream. |
| 34 | +# Instead of pure dictionaries, this package uses functions to provide |
| 35 | +# the data of the tables necessary to decompress streams. Advantage: |
| 36 | +# functions are 'read-only' and can provide error feedback. |
| 37 | +# Disadvantage: overhead, runtime. But it is considered to be minimal. |
| 38 | +# In order to reduce the extra time a little bit, all tables are |
| 39 | +# 'complete', i.e. each entry just needs to be extracted but not |
| 40 | +# calculated. The difference is minimal and practical non-existant |
| 41 | +# when accessing a function one time only; but these functions can be |
| 42 | +# called hundred or thousand times per stream. |
37 | 43 |
|
38 | 44 | # Import stuff
|
39 | 45 | import struct
|
|
0 commit comments