r/tinycode • u/0b011 • Dec 15 '13
gzip decoder in 25 lines of C
https://github.com/choobin/obfuslate/blob/master/obfuslate.c
24
Upvotes
8
u/zifyoip Dec 15 '13
What is this number 37268 that appears in several places? Is that supposed to be 32768?
3
u/0b011 Dec 15 '13
Well that is embarrassing. I have been staring at the code for so long that I missed one of the most important aspects of deflate -- its window size. Kudos to you sir. I hang my head in shame and quickly run to a terminal to fix it. Gailly and Adler would have my head!
9
u/raydeen Dec 15 '13
#define I
#define N
#define F
#define L
#define A
#define T
#define EGood one. :)
6
-3
8
u/lifthrasiir Dec 15 '13
Great. For your information, the IOCCC had the similar entry (1996/rcm). I have a number of questions (e.g. is there a particular reason to use a GNU extension
({...})instead of functions?) and suggestions (e.g.c=0;if(a<j)c+=37268;->c=(a<j)*37268;) but I'm running out of spare time ;)