zlib-rs
A memory-safe zlib implementation written in rust
0.6.7
115M downloads/mo
#739 most downloaded on crates.io
trifectatechfoundation/zlib-rs
What this package is like to depend on
Last release 20 days ago
03 Aug 2026
Release timing varies
gaps range from 9 days to 4 months
Some releases are documented
notes for 10 of 24 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
24 releases · first in 2024
12 releases in the last 12 months
see the full history below
Release timeline
24 releases · Feb 2024 to Aug 2026Releases
latest 24-
0.6.703 Aug 2026Release notes
Open source →What's Changed
- add
linux-loongarch64runner by @folkertdev in #543 - Benchmark flags by @folkertdev in #544
- forward lsx feature by @folkertdev in #545
- dummy commit to force a benchmark run on main by @folkertdev in #546
- Add LSX compare256 implementation by @Gelbpunkt in #547
- inflate: Use wider loads/stores with LSX by @Gelbpunkt in #548
- Remove redundant casts by @FranciscoTGouveia in #549
- run with address sanitizer in CI by @folkertdev in #550
- cleanup trace statements by @folkertdev in #554
- Fix use-after-free in
set_levelby @folkertdev in #552
New Contributors
- @FranciscoTGouveia made their first contribution in #549
Full Changelog: v0.6.6...v0.6.7
- add
-
0.6.609 Jul 2026Release notes
Open source →What's Changed
We now support the zlib 1.3.2 API, including
deflateUsedand various symbols suffixed by_zto indicate that they useusizefor lengths. That is mostly useful on targets wherec_ulongis only a 32-bit integer.- fix unsound return lifetime on Weak*Mut::as_mut_slice() by @Manishearth in #539
- add
deflateUsedby @folkertdev in #534 - add
{compress, uncompress, etc.}_zvariants that takeusizefor lengths by @folkertdev in #535
New Contributors
- @Manishearth made their first contribution in #539
Full Changelog: v0.6.5...v0.6.6
-
0.6.501 Jul 2026Release notes
Open source →What's Changed
Fixes an MSRV issue on AArch64.
- deflate: elide dead bounds check in longest_match chain walk by @StefanoD in #527
- Improve the LoongArch CRC32 implementation based on the AArch64 one by @Gelbpunkt in #529
- Add a build and test job for loongarch64 by @Gelbpunkt in #530
- Add LSX-autovectorized slide hash by @Gelbpunkt in #532
- Add LSX-optimized adler32 implementation by @Gelbpunkt in #533
- check MSRV on more targets by @folkertdev in #538
New Contributors
Full Changelog: v0.6.3...v0.6.5
-
0.6.421 Jun 2026Release notes
Open source →What's Changed
Adds a fix for the raptor lake CPU bug and for an off-by-one error in adler32 on aarch64 resulting in an incorrect checksum.
- Run AVX-512 tests only if AVX-512 is available by @Shnatsel in #484
- Various CI improvements suggested by zizmor by @bjorn3 in #485
- run CI for powerpc64le by @folkertdev in #489
- use the vnni ilp trick for standard avx512 by @folkertdev in #488
- remove `dynamic-libz-sys by @folkertdev in #490
- prepare for miri supporting the crc intrinsics by @folkertdev in #492
- fix aliasing bug in
infbackby @folkertdev in #497 - clarify
gzopenbehavior aroundlseek64by @folkertdev in #493 - run miri on aarch64 testing SIMD code by @folkertdev in #498
- fix internal API OOB read by @folkertdev in #496
- add uninit versions of stable compress and decompress by @folkertdev in #501
- clippy: unnecessary
>= y + 1orx - 1 >=by @folkertdev in #503 - document the behavior of
window_bitsby @folkertdev in #505 - [bug fix] adler32: reduce
pairmod BASE afterhandle_tailon aarch64 NEON by @shenxiul in #504 - fix missing input validation in
inflateBackInit_by @folkertdev in #507 - return
NULLwhen the requested allocation is too large by @folkertdev in #508 - fix and test
aarch64_beby @folkertdev in #512 - disable aarch64_be miri run by @folkertdev in #517
- crc32: add options to ARM inline asm by @inahga in #516
- crc32: Add implementation for loongarch64 by @Gelbpunkt in #511
- bump libz-sys to 1.1.29 by @folkertdev in #519
- update
Cargo.lockby @folkertdev in #521 - Work around crash on Intel Raptor Lake CPU by @glandium in #520
- test the
loongarch64crc32 implementation with Miri by @folkertdev in #523 - Use the stock zlib crc32 approach on aarch64 by @folkertdev in #513
New Contributors
- @Shnatsel made their first contribution in #484
- @shenxiul made their first contribution in #504
- @Gelbpunkt made their first contribution in #511
- @glandium made their first contribution in #520
Full Changelog: v0.6.3...v0.6.4
-
0.6.302 Mar 2026Release notes
Open source →Highlights
A while ago a bug was reported in zlib-rs #459, which turned out to also exist in zlib-ng. zlib-ng has now fixed the bug and made a new release, and we're following suit here. This fix can change the output of compression slightly.
What's Changed
- gate tests on features they use by @alexanderkjall in #475
- the zalloc_rust and zalloc_rust_calloc functions are behind the rust-allocator feature by @alexanderkjall in #476
- add test for deterministic deflate output by @folkertdev in #461
- fix compilation errors for 'cargo test --all-features' by @alexanderkjall in #477
- Run all the gz tests when building on macOS by @brian-pane in #479
- ensure that
all-featuresand--no-default-featuresbuilds by @folkertdev in #480
New Contributors
- @alexanderkjall made their first contribution in #475
Full Changelog: v0.6.2...v0.6.3
-
0.6.217 Feb 2026Release notes
Open source → -
0.6.117 Feb 2026Release notes
Open source →What's Changed
- Replace run-time asserts with compile time in deflate tally functions by @brian-pane in #450
- Simplify the emit_match function in the medium deflate algorithm by @brian-pane in #451
- fuzzers: fix build with 32-bit targets by @Mrmaxmeier in #452
- Remove no-op
as _casts with return codes by @Mrmaxmeier in #456 - fuzzers: Use bytes instead of string inputs by @Mrmaxmeier in #453
- Remove use of allow(unsafe_op_in_unsafe_fn) from adler32 NEON impl by @brian-pane in #458
- Additional test coverage for inflate/window.rs by @brian-pane in #460
- Move State to beginning of inflate/deflate allocations, fix overallocation during inflate by @spectral54 in #457
- Fix
compressreturning incorrect error value by @Mrmaxmeier in #454 - turn
C-unwindinto justCby @folkertdev in #441 - use
stdby default when building acdylibby @folkertdev in #462 - add vnni adler32 variant by @folkertdev in #448
- Move gz back by @folkertdev in #447
- bump
getrandomto0.2.17by @folkertdev in #464 - do not export zlib-rs macros by @folkertdev in #466
gzdocs updates by @folkertdev in #463- Hide more symbols by @folkertdev in #467
- Add safety comments to Writer implementation by @brian-pane in #403
- fixups for some doc comments by @folkertdev in #468
inftrees.rsimprovements by @folkertdev in #471- fix overflow on
total_{in, out}on windows by @folkertdev in #473
New Contributors
- @Mrmaxmeier made their first contribution in #452
- @spectral54 made their first contribution in #457
Full Changelog: v0.5.5...v0.6.1
-
0.6.023 Jan 2026Release notes
Open source →breaking changes
libz-rs-sys
- functions that used
extern "C-unwind"before now useextern "C". This helps when building zlib-rs as a C library, because unwinding from rust into C is UB. Now, if a panic does occur in the rust code, it will abort the program at the FFI boundary rather than unwind into C code. If you do really need unwinding in rust code, we suggest usingflate2or usingzlib-rsdirectly.
zlib-rs
- the internals are no longer publicly exposed. If you were using some unstable symbol before, and it is no longer exported, but you do believe it would be reasonable for us to provide it, let us know.
- the
uncompress_slicefunction was renamed todecompress_slice
other highlights
- the
gz*functions are now included in the main crate. Thanks again to @brian-pane for implementing these. - overall we now provide all public symbols that zlib-ng provides (e.g.
inflateBackwas added). Thegzprintfandgzvprintffunctions need nightly though. - improved
avx512support.
What's Changed
- Replace run-time asserts with compile time in deflate tally functions by @brian-pane in #450
- Simplify the emit_match function in the medium deflate algorithm by @brian-pane in #451
- fuzzers: fix build with 32-bit targets by @Mrmaxmeier in #452
- Remove no-op
as _casts with return codes by @Mrmaxmeier in #456 - fuzzers: Use bytes instead of string inputs by @Mrmaxmeier in #453
- Remove use of allow(unsafe_op_in_unsafe_fn) from adler32 NEON impl by @brian-pane in #458
- Additional test coverage for inflate/window.rs by @brian-pane in #460
- Move State to beginning of inflate/deflate allocations, fix overallocation during inflate by @spectral54 in #457
- Fix
compressreturning incorrect error value by @Mrmaxmeier in #454 - turn
C-unwindinto justCby @folkertdev in #441 - use
stdby default when building acdylibby @folkertdev in #462 - add vnni adler32 variant by @folkertdev in #448
- Move gz back by @folkertdev in #447
- bump
getrandomto0.2.17by @folkertdev in #464 - do not export zlib-rs macros by @folkertdev in #466
gzdocs updates by @folkertdev in #463- Hide more symbols by @folkertdev in #467
- Add safety comments to Writer implementation by @brian-pane in #403
- fixups for some doc comments by @folkertdev in #468
New Contributors
- @Mrmaxmeier made their first contribution in #452
- @spectral54 made their first contribution in #457
Full Changelog: v0.5.5...v0.6.0
- functions that used
-
0.5.522 Dec 2025Release notes
Open source →What's Changed
- use global allocator by @folkertdev in #446
- handle input/output buffers with lengths that overflow
c_uintby @folkertdev in #449
Full Changelog: v0.5.4...v0.5.5
-
0.5.410 Dec 2025Release notes
Open source →What's Changed
- Export missing functions by @folkertdev in #440
- expose
gzvprintfby @folkertdev in #435 - expose
uncompress2by @folkertdev in #436 - use the new
c_variadicAPI by @folkertdev in #443 - test ABI compatibility with zlib-ng on CI by @folkertdev in #442
- add
set_dictionaryandset_levelto stable api by @folkertdev in #444
Full Changelog: v0.5.3...v0.5.4
-
0.5.303 Dec 2025Nothing published for this version
-
0.5.202 Sep 2025Nothing published for this version
-
0.5.106 Jun 2025Nothing published for this version
-
0.5.001 Apr 2025Nothing published for this version
-
0.4.220 Feb 2025Nothing published for this version
-
0.4.116 Dec 2024Nothing published for this version
-
0.4.014 Nov 2024Nothing published for this version
-
0.3.104 Oct 2024Nothing published for this version
-
0.3.005 Sep 2024Nothing published for this version
-
0.2.108 Jul 2024Nothing published for this version
-
0.2.012 Jun 2024Nothing published for this version
-
0.1.122 Apr 2024Nothing published for this version
-
0.1.016 Apr 2024Nothing published for this version
-
0.0.123 Feb 2024Nothing published for this version