3 ms·
I went through something similar a year or so ago. I wrote deflate for a little javascript PDF writer. For my first pass, I used the static tables. A little res
by dunham 5y ago
I went through something similar a year or so ago. I wrote deflate for a little javascript PDF writer. For my first pass, I used the static tables. A little research pointed me at package merge (I think Go used it, and zlib itself was inscrutable). After a couple of evenings, I gave up on it as not worth the effort, since my primary goal was writing PDFs, not implementing zlib.
From the article, it sounds like zlib might not even be using package-merge.
- Rendello 5y agoRelatedly, I was looking at Zlib's source today and realized they still use old, 70s-style function declarations: int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) Bytef *dest; uLongf *destLen; const Bytef *source; uLong sourceLen; int level; { z_stream stream; int err; const uInt max = (uInt)-1; … https://github.com/madler/zlib/blob/master/compress.c https://github.com/madler/zlib/blob/master/compress.c