Registry / utility / brotli2

brotli2

JSON →
library0.3.2rscratesunverified

Bindings to libbrotli for Brotli compression and decompression.

# Cargo.toml [dependencies] brotli2 = "0.3.2"
INSTALL
IMPORT
SIG · BROTLI2
B
brotli2
utilityrustv0.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BrotliDecoder
use brotli2::read::BrotliDecoder;

Decompresses Brotli-compressed data using a streaming decoder.

use brotli2::read::BrotliDecoder; use std::io::Read; fn main() { let compressed = vec![0x0b, 0x00, 0x80, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64]; let mut decoder = BrotliDecoder::new(&compressed[..]); let mut output = String::new(); decoder.read_to_string(&mut output).unwrap(); println!("{}", output); }
Debug
Known issues
gotchaRequires libbrotli system library or feature flag for static linking.
fix
Add 'vendored' feature to Cargo.toml: brotli2 = { version = "0.3", features = ["vendored"] }
affects: >=0.3.0
Upgrade
Version history
0.3.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
brotli2 — cargo add brotli2 · libregistry