Settings

Theme

Show HN: Gzip decompressor in ~300 lines of readable Python

github.com

4 points by Laiho 2 years ago · 2 comments

Reader

mxmlnkn 2 years ago

The code looks clean and it works. It's fun to implement your own understandable parser. After doing such an exercise, suddenly a seemingly complex file format doesn't look like such a black box anymore. When I implemented my decompressor, I also looked at https://github.com/pfalcon/pyflate , to understand and verify the inner gzip/deflate RFC workings. Pyflate is also pretty small, especially after removing the bzip2 code, after which only ~450 lines are left. Laiho's code seems more readable, though.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection