{"id":15826881,"url":"https://github.com/trifectatechfoundation/zlib-rs","last_synced_at":"2025-05-14T11:10:49.384Z","repository":{"id":215835982,"uuid":"727553847","full_name":"trifectatechfoundation/zlib-rs","owner":"trifectatechfoundation","description":"A safer zlib","archived":false,"fork":false,"pushed_at":"2025-05-07T09:47:19.000Z","size":14767,"stargazers_count":468,"open_issues_count":19,"forks_count":21,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-07T10:38:30.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trifectatechfoundation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["trifectatechfoundation"],"custom":["https://trifectatech.org/support/"]}},"created_at":"2023-12-05T05:04:21.000Z","updated_at":"2025-05-07T01:40:09.000Z","dependencies_parsed_at":"2024-05-03T11:52:58.114Z","dependency_job_id":"7f82ae23-7c6a-4f32-b09b-695d8ebf5e0b","html_url":"https://github.com/trifectatechfoundation/zlib-rs","commit_stats":{"total_commits":613,"total_committers":17,"mean_commits":36.05882352941177,"dds":"0.14029363784665583","last_synced_commit":"afa1b5b827549d30902c4e2044a4cc453821fb6d"},"previous_names":["memorysafety/zlib-rs","trifectatechfoundation/zlib-rs"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trifectatechfoundation%2Fzlib-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trifectatechfoundation%2Fzlib-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trifectatechfoundation%2Fzlib-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trifectatechfoundation%2Fzlib-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trifectatechfoundation","download_url":"https://codeload.github.com/trifectatechfoundation/zlib-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129489,"owners_count":22019628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-05T10:01:08.641Z","updated_at":"2025-05-14T11:10:49.363Z","avatar_url":"https://github.com/trifectatechfoundation.png","language":"Rust","funding_links":["https://github.com/sponsors/trifectatechfoundation","https://trifectatech.org/support/"],"categories":["Rust","C2Rust And Automated Translation Case Studies"],"sub_categories":[],"readme":"![checks](https://github.com/trifectatechfoundation/zlib-rs/actions/workflows/checks.yaml/badge.svg?branch=main)\n[![codecov](https://codecov.io/gh/trifectatechfoundation/zlib-rs/graph/badge.svg?token=KZLDE24YVL)](https://codecov.io/gh/trifectatechfoundation/zlib-rs)\n[![Crates.io](https://img.shields.io/crates/v/libz-rs-sys.svg)](https://crates.io/crates/libz-rs-sys)\n\n\n# zlib-rs: a safer zlib\n\nThis repository contains a Rust implementation of the zlib file format that is compatible with the zlib API.\n\nThis repository contains two public crates:\n\n* [zlib-rs](https://crates.io/crates/zlib-rs/), a Rust implementation based on [zlib](https://www.zlib.net/manual.html)\n  with a safe rust API. This API is under development and still unstable.\n* [libz-rs-sys](https://crates.io/crates/libz-rs-sys/), a zlib-compatible C API for usage in non-Rust\n  applications.\n\n## How to use zlib-rs in your project\n\nzlib-rs can be used in both Rust and C projects.\n\n### Rust projects\n\nBy far the easiest way to use zlib-rs is through the [flate2](https://crates.io/crates/flate2) crate, by simply enabling the `zlib-rs` feature gate. This will enable the `zlib-rs`\nbackend.\n\n### C projects\n\nzlib-rs can be built as a shared object file for usage by C programs that dynamically link to zlib. Please see the example in [libz-rs-sys-cdylib](https://github.com/trifectatechfoundation/zlib-rs/tree/main/libz-rs-sys-cdylib).\n\n## Performance\n\nPerformance is generally on-par with [zlib-ng].\n\n### Compiler Flags\n\nCompiler flags that can be used to improve performance.\n\n#### `-Ctarget-cpu=...`\n\nProviding more information about the SIMD capabilities of the target machine can improve performance. E.g.\n\n```\nRUSTFLAGS=\"-Ctarget-cpu=native\" cargo build --release ...\n```\n\nThe resulting binary statically assumes the SIMD capabilities of the current machine.\n\nNote: binaries built with `-Ctarget-cpu` almost certainly crash on systems that don't have the specified CPU! Only use this flag if you control how the binary is deployed, and can guarantee that the CPU assumptions are never violated.\n\n#### `-Cllvm-args=-enable-dfa-jump-thread`\n\nFor best performance with very small input sizes, compile with:\n\n```\nRUSTFLAGS=\"-Cllvm-args=-enable-dfa-jump-thread\" cargo build --release ...\n```\n\nThis flag gives around a 10% boost when the input arrives in chunks of 16 bytes, and a couple percent when input arrives in chunks of under 1024 bytes. Beyond that, the effect is not significant. Using this flag can lead to longer compile times, but otherwise has no adverse effects.\n\n## Acknowledgments\n\nThis project is heavily based on the [zlib](https://github.com/madler/zlib) and [zlib-ng] projects.\n\n## About\n\nzlib-rs is part of Trifecta Tech Foundation's [Data compression initiative](https://trifectatech.org/initiatives/data-compression/).\n\n## History\n\nThe initial development of zlib-rs was started and funded by the [Internet Security Research Group](https://www.abetterinternet.org/) as part of the [Prossimo project](https://www.memorysafety.org/).\n\n[zlib-ng]: https://github.com/zlib-ng/zlib-ng\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrifectatechfoundation%2Fzlib-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrifectatechfoundation%2Fzlib-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrifectatechfoundation%2Fzlib-rs/lists"}