<div align="center">
<img src="https://devhub.vip/pages/docs/img/hyperlane.png" alt="http-compress logo" height="120">
# http-compress
**Bounded Gzip, Deflate & Brotli HTTP Compression Codecs**
[](https://crates.io/crates/http-compress)
[](https://docs.rs/http-compress)
[](https://github.com/hyperlane-dev/hyperlane/actions/workflows/rust.yml)
[](https://www.rust-lang.org)
[](../LICENSE)
[Workspace Overview](../README.md) ยท [API Docs](https://docs.rs/http-compress/latest/)
</div>
---
## Overview
`http-compress` provides bounded HTTP payload compression and decompression codecs (`gzip`, `deflate`, `brotli`) and `Accept-Encoding` negotiation shared by [`hyperlane`](../README.md) servers, clients, and middleware plugins.
## Installation
```sh
cargo add http-compress
```
## Usage
```rust
use std::borrow::Cow;
use http_compress::Compress;
fn compress_payload(payload: &[u8]) -> Cow<'_, [u8]> {
Compress::Gzip.encode(payload, 4096)
}
```
## Verification
```sh
cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p http-compress --all-features --all-targets -- -D warnings
cargo test -p http-compress --all-features
```
## License
This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details.
## Contact
For inquiries, please contact the author at [root@devhub.vip](mailto:root@devhub.vip).