Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. rust-brotli

rust-brotli

BSD-3-ClauseRust1.0.110

A pure Rust implementation of the Brotli compression algorithm with optional no-stdlib support for embedded and kernel use.

Visit WebsiteGitHubGitHub
919 stars96 forks0 contributors

What is rust-brotli?

rust-brotli is a Rust library that implements the Brotli compression and decompression algorithm. It provides a safe, efficient way to compress and decompress data in Rust applications, with optional support for environments without the standard library. The library is designed to be bitwise-identical to the original C implementation, ensuring compatibility with existing Brotli tools and formats.

Target Audience

Rust developers working on performance-sensitive applications, embedded systems, kernels, or projects requiring Brotli compression without C dependencies. It's also suitable for C/C++ developers looking for a drop-in replacement via its FFI interface.

Value Proposition

Developers choose rust-brotli for its no-stdlib capability, making it ideal for constrained environments, and its full compatibility with the Brotli standard. The Rust implementation offers memory safety and modern tooling while matching the performance and output of the canonical C version.

Overview

Brotli compressor and decompressor written in rust that optionally avoids the stdlib

Use Cases

Best For

  • Compressing data in embedded Rust projects without stdlib access
  • Replacing the C Brotli library in existing projects via FFI
  • Building streaming compression pipelines with concatenatable streams
  • Implementing Brotli compression in Rust kernels or OS development
  • Benchmarking compression algorithms in Rust vs C implementations
  • Applications requiring fine-grained memory management with custom allocators

Not Ideal For

  • Projects using languages without Rust or C bindings, where native compression libraries might be simpler
  • Teams prioritizing quick setup over advanced features, as manual memory management and FFI configuration add complexity
  • Applications requiring real-time compression with minimal overhead, since multithreaded modes may introduce latency
  • Environments where Brotli isn't a requirement, and lighter algorithms like LZ4 or Snappy would suffice

Pros & Cons

Pros

No-Stdlib Support

Operates without the Rust standard library, enabling use in embedded systems and kernels, as demonstrated by the manual memory management example with custom allocators.

FFI Compatibility

Provides a drop-in C API replacement for Google's Brotli library, allowing seamless integration into existing C/C++ projects, with build instructions in the c subdirectory.

Stream Concatenation Features

Supports appendable and catable streams for efficient data concatenation in streaming scenarios, with detailed parameter interactions and tooling like catbrotli.

Custom Allocator Control

Allows fine-grained memory management with custom allocators, essential for performance-critical or resource-constrained environments, as shown in the no-stdlib setup.

Cons

Complex Manual Setup

Manual memory management requires verbose boilerplate code for allocators and state handling, making it less accessible for simple use cases compared to higher-level APIs.

Breaking Changes Risk

Frequent major version updates (e.g., 8.0.0, 7.0.0) with fixes like memory leaks indicate potential instability and migration effort for long-term projects.

FFI Integration Overhead

FFI is not enabled by default to avoid ODR issues, and past memory leaks (fixed in 8.0.2) require careful configuration, adding integration complexity.

Frequently Asked Questions

Quick Stats

Stars919
Forks96
Contributors0
Open Issues23
Last commit5 months ago
CreatedSince 2016

Tags

#embedded#ffi#brotli#safe#data-compression#rustlang#streaming#decompression#compression#rust#no-std

Built With

R
Rust

Links & Resources

Website

Included in

Rust56.6k
Auto-fetched 6 hours ago

Related Projects

flate2-rsflate2-rs

DEFLATE, gzip, and zlib bindings for Rust

Stars1,099
Forks193
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub