http-compress 23.4.0

A high-performance async library for HTTP compression/decompression, supporting Brotli, Deflate, and Gzip algorithms. Provides both compression and decompression capabilities with optimized memory usage, ideal for HTTP clients/servers and network programming.
Documentation
<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**

[![Crates.io Version](https://flat.badgen.net/crates/v/http-compress)](https://crates.io/crates/http-compress)
[![Docs.rs](https://img.shields.io/docsrs/http-compress?style=flat-square)](https://docs.rs/http-compress)
[![CI Status](https://img.shields.io/github/actions/workflow/status/hyperlane-dev/hyperlane/rust.yml?branch=master&style=flat-square&label=CI)](https://github.com/hyperlane-dev/hyperlane/actions/workflows/rust.yml)
[![Rust 2024](https://img.shields.io/badge/edition-2024-orange.svg?style=flat-square)](https://www.rust-lang.org)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](../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).