{"id":18718058,"url":"https://github.com/image-rs/deflate-rs","last_synced_at":"2025-04-06T04:15:10.208Z","repository":{"id":53538170,"uuid":"58674130","full_name":"image-rs/deflate-rs","owner":"image-rs","description":"An implementation of a DEFLATE encoder in rust","archived":false,"fork":false,"pushed_at":"2021-11-10T17:03:29.000Z","size":789,"stargazers_count":54,"open_issues_count":7,"forks_count":14,"subscribers_count":8,"default_branch":"dev","last_synced_at":"2025-03-30T03:08:42.914Z","etag":null,"topics":["compression","deflate","gzip","rust","zlib"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/image-rs.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-12T20:22:44.000Z","updated_at":"2024-11-18T03:18:24.000Z","dependencies_parsed_at":"2022-08-29T05:40:20.716Z","dependency_job_id":null,"html_url":"https://github.com/image-rs/deflate-rs","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-rs%2Fdeflate-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-rs%2Fdeflate-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-rs%2Fdeflate-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/image-rs%2Fdeflate-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/image-rs","download_url":"https://codeload.github.com/image-rs/deflate-rs/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430963,"owners_count":20937875,"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":["compression","deflate","gzip","rust","zlib"],"created_at":"2024-11-07T13:19:17.561Z","updated_at":"2025-04-06T04:15:10.187Z","avatar_url":"https://github.com/image-rs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deflate-rs\n\n[![Crates.io](https://img.shields.io/crates/v/deflate.svg)](https://crates.io/crates/deflate)[![Docs](https://docs.rs/deflate/badge.svg)](https://docs.rs/deflate)\n\n\nAn implementation of a [DEFLATE](http://www.gzip.org/zlib/rfc-deflate.html) encoder in pure Rust. Not a direct port, but does take some inspiration from [zlib](https://www.zlib.net/), [miniz](https://github.com/richgel999/miniz) and [zopfli](https://github.com/google/zopfli). The API is based on the one in the [flate2](https://crates.io/crates/flate2) crate that contains bindings, zlib miniz_oxide, and miniz.\n\nDeflate encoding with and without zlib and gzip metadata (zlib dictionaries are not supported) is supported. No unsafe code is used.\n\nEncoding in gzip format requires enabling the 'gzip' feature.\n\nThis library is now mostly in maintenance mode, focus being on the Rust backend of [flate2](https://crates.io/crates/flate2) instead.\n\nThe minimum required Rust version is 1.32.0 due to use of library functions for endinaness conversion (unit tests requires a newer version).\n\n# Usage:\n## Simple compression function:\n``` rust\nuse deflate::deflate_bytes;\n\nlet data = b\"Some data\";\nlet compressed = deflate_bytes(\u0026data);\n```\n\n## Using a writer:\n\n``` rust\nuse std::io::Write;\n\nuse deflate::Compression;\nuse deflate::write::ZlibEncoder;\n\nlet data = b\"This is some test data\";\nlet mut encoder = ZlibEncoder::new(Vec::new(), Compression::Default);\nencoder.write_all(data).unwrap();\nlet compressed_data = encoder.finish().unwrap();\n```\n\n# Other deflate/zlib Rust projects from various people\n* [flate2](https://github.com/rust-lang/flate2-rs) FLATE, Gzip, and Zlib bindings for Rust - can use miniz_oxide for a pure Rust implementation.\n* [Zopfli in Rust](https://github.com/carols10cents/zopfli) Rust port of zopfli\n* [inflate](https://github.com/image-rs/inflate) DEFLATE decoder implemented in Rust\n* [miniz-oxide](https://github.com/Frommi/miniz_oxide) Port of miniz to Rust.\n* [libflate](https://github.com/sile/libflate) Another DEFLATE/Zlib/Gzip encoder and decoder written in Rust. (Only does some very light compression).\n\n# License\ndeflate is distributed under the terms of both the MIT and Apache 2.0 licences.\n\nbitstream.rs is © @nwin and was released under both MIT and Apache 2.0\n\nSome code in length_encode.rs has been ported from the `miniz` library, which is public domain.\n\nThe test data (tests/pg11.txt) is borrowed from [Project Gutenberg](https://www.gutenberg.org/ebooks/11) and is available under public domain, or the Project Gutenberg Licence\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage-rs%2Fdeflate-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimage-rs%2Fdeflate-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimage-rs%2Fdeflate-rs/lists"}