madler/zlib
View on GitHub ↗ ★ 7,186 C
A massively spiffy yet delicately unobtrusive compression library.
30 mentions on Hacker News by 27 people: 2 stories, 28 comments · first 2017-02-11 · latest 2026-07-16
20082026
-
…up; deflate has a very small, upper bound. But for short inputs this advantage is diminished. [1] https://github.com/madler/zlib/blob/develop/contrib/puff/puf... [2] https://blog.cloudflare.com/improving-compression-with-prese...
comment by wahern · 2026-07-16 · in Optimizing Lua string literals to save 400 bytes -
Original zlib code: https://github.com/madler/zlib/blob/develop/contrib/puff/puf... The code of the article: https://github.com/ieviev/mini-gzip/blob/main/src/main.rs Top level declarations of the C code: #define MAXBITS 15 #define…
comment by Rexxar · 2026-03-28 · in Gzip decompression in 250 lines of Rust -
…pre-computed table of 256× 32-bit constants so that one byte can processed at a time. For example: https://github.com/madler/zlib/blob/7cdaaa09095e9266dee21314...
comment by nayuki · 2026-03-27 · in Gzip decompression in 250 lines of Rust -
he does mention https://github.com/trifectatechfoundation/zlib-rs not just https://github.com/madler/zlib , but it would be interesting to hear from those developers also
comment by hybrid_study · 2026-03-27 · in Gzip decompression in 250 lines of Rust -
…Rust code, it appears to be a fairly straightforward port of puff.c (included in the zlib source): https://github.com/madler/zlib/blob/develop/contrib/puff/puf...
comment by stgn · 2026-03-27 · in Gzip decompression in 250 lines of Rust -
…to literal("TOBEORNOT") copy(6,9) copy(9,15)? IIRC zlib won't consider matches at offset 0: https://github.com/madler/zlib/blob/5a82f71ed1dfc0bec044d970...
comment by zmodem · 2025-09-18 · in Understanding Deflate -
It's true, using some rather non-obvious trickery: https://github.com/madler/zlib/blob/develop/examples/zran.c I also wrote a tool to make a randomly modifiable gzipped disk image: https://rwmj.wordpress.com/2022/12/01/creating-a-modifiable…
comment by rwmj · 2025-06-16 · in Show HN: Zeekstd – Rust Implementation of the ZSTD Seekable Format -
Most if not all of bash. zlib changed it just a few months ago (1.3 release from August): https://github.com/madler/zlib/issues/633 I've also seen it in some FreeBSD code, but that was quite a few years ago and I don't know to what degree…
comment by arp242 · 2023-12-23 · in Xmas.c (1988) -
…codes) that didn't match actual (malicious) input. Or, in zlib-the-library, there's other C code ( https://github.com/madler/zlib/blob/ac8f12c97d1afd9bafa9c710... ) that rejects unbalanced Huffman codes, but IIUC similar enforcement was…
comment by nigeltao · 2023-09-22 · in The WebP 0day -
…spot, an automated test based on the domain knowledge is likely useless to catch this bug. [1] https://github.com/madler/zlib/blob/master/examples/enough.c
comment by lifthrasiir · 2023-09-12 · in Chrome: Heap buffer overflow in WebP -
▲ 2
Zlib 1.3 · madler/zlib 09155eastory by todsacerdoti · 2023-08-19 · 0 comments
-
zlib: https://github.com/madler/zlib
comment by jhasse · 2023-08-13 · in Exploring the Internals of Linux v0.01 -
…(that you’d need for PNG) is not exactly complex[1], although slower than mainline zlib. [1] https://github.com/madler/zlib/tree/master/contrib/puff
comment by mananaysiempre · 2022-12-18 · in Quite OK Image is now my favorite asset format -
These appear to be the relevant changes: 2022-07-30: https://github.com/madler/zlib/commit/eff308af425b67093bab25... 2022-08-08: https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae3... The second commit definitely fixed a null…
comment by omoikane · 2022-10-15 · in Zlib Critical Vulnerability -
…preflate [2] leverages this to store the deflate stream reconstruction data without much bits. [1] https://github.com/madler/zlib/blob/21767c6/deflate.c#L134-L... [2] https://github.com/deus-libri/preflate/blob/master/preflate_...
comment by lifthrasiir · 2022-09-10 · in Gzip and Brotli Compression Level Estimator -
It's still a full plate of old good C spaghetti https://github.com/madler/zlib/commit/eff308af425b67093bab25...
comment by GoblinSlayer · 2022-08-30 · in What does it take to be a good programmer? -
The non-forked zlib hasn't been accepting optimisations: https://github.com/madler/zlib/issues/346 Hopefully changes will be merged from my obscure private fork into four other obscure private forks (zlib-chromium (…
comment by dougall · 2022-08-21 · in Faster zlib/DEFLATE decompression on the Apple M1 (and x86) -
It was fixed in 2018, but no release was made at the time https://github.com/madler/zlib/commit/5c44459c3b28a9bd3283aa...
comment by kam · 2022-03-28 · in Re: Zlib memory corruption on deflate -
…on some input when using Z_FIXED"). Yet, in what seems to be the canonical Zlib repository ( https://github.com/madler/zlib ), I was unable to find a corresponding commit. None of commits this year (7, so not too hard to review) seem to be…
comment by mdb31 · 2022-03-28 · in Re: Zlib memory corruption on deflate -
Zlib's implementation, at least, requires more working RAM (~40 KB) than the Game Boy has (8 KB). https://github.com/madler/zlib/blob/master/zconf.h The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for…
comment by retrac · 2022-02-20 · in Game Boy Wordle clone: How to compress 12972 five-letter words to 17871 bytes -
…/en.wikipedia.org/wiki/GNU_coding_standards Zlib still uses K&R-1st-edition-era function definitions: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da...
comment by Rendello · 2022-01-30 · in Ask HN: Examples of Unusual Code Formatting Styles? -
…tries to create a home for many of the improvements, but is at the same time yet another fork. [0] https://github.com/madler/zlib/commits/develop [1] https://github.com/madler/zlib/pull/525 [2] https://github.com/jtkukunas/zlib [3]…
comment by zmodem · 2022-01-26 · in Zlib – a spiffy yet delicately unobtrusive compression library -
…a massive speedup in my experience up to 20x for decompression and 220x (!) for compression [0]: https://github.com/madler/zlib/pull/410
comment by erk__ · 2022-01-26 · in Zlib – a spiffy yet delicately unobtrusive compression library -
…also point interested readers towards zlib-ng [5] (without any endorsement or affiliation). [0]: https://github.com/madler/zlib/blob/master/inffast.c#L12 [1]: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da... [2]:…
comment by MauranKilom · 2022-01-26 · in Zlib – a spiffy yet delicately unobtrusive compression library -
▲ 46
Zlib – a spiffy yet delicately unobtrusive compression librarystory by maydemir · 2022-01-24 · 23 comments
-
…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
comment by Rendello · 2021-09-13 · in Length-Limited Prefix Codes -
Does minizip, which in included in zlib, have the same bug. https://github.com/madler/zlib/tree/master/contrib/minizip
comment by 1vuio0pswjnm7 · 2021-05-01 · in Redbean 0.4 -
Does gzip actually use zlib? zlib's implementation ( https://github.com/madler/zlib/blob/v1.1.3/inflate.c ) looks different at first glance, gzip predates it by three years, and I believe gzip is also noticeably slower.
comment by duckerude · 2020-10-19 · in Dr.Mario 64's gzip implementation is taken almost verbatim from gzip source code -
…Few (or none?) of Chrome's fairly dramatic improvements to zlib have been upstreamed. https://github.com/madler/zlib/issues/346 Edit: Also, if browsers do adopt zstd, it's likely you'll end up with the same situation where they fork their…
comment by tyingq · 2020-01-05 · in Now using Zstandard instead of xz for package compression -
Mark Adler, the maintainer, has it here https://github.com/madler/zlib
comment by noselasd · 2017-02-11 · in After nearly 4 years, a bunch of bugfixes to zlib