http-compress 23.0.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
/// The header name for content encoding.
pub(crate) const CONTENT_ENCODING: &str = "content-encoding";

/// An empty string.
pub(crate) const EMPTY_STR: &str = "";

/// The content encoding type for gzip.
pub(crate) const CONTENT_ENCODING_GZIP: &str = "gzip";

/// The legacy alias for the gzip content encoding.
pub(crate) const CONTENT_ENCODING_X_GZIP: &str = "x-gzip";

/// The content encoding type for deflate.
pub(crate) const CONTENT_ENCODING_DEFLATE: &str = "deflate";

/// The content encoding type for brotli.
pub(crate) const CONTENT_ENCODING_BROTLI: &str = "br";

/// The default brotli compression quality.
pub(crate) const BROTLI_DEFAULT_QUALITY: u32 = 5;

/// The default brotli sliding window size, in bits.
pub(crate) const BROTLI_DEFAULT_WINDOW_BITS: u32 = 22;

/// The comma that separates two codings of an `Accept-Encoding` field value.
pub(crate) const ACCEPT_ENCODING_SEPARATOR: char = ',';

/// The semicolon that introduces a parameter of a coding.
pub(crate) const PARAMETER_SEPARATOR: char = ';';

/// The equal sign that joins a parameter name to its value.
pub(crate) const PARAMETER_ASSIGN: char = '=';

/// The wildcard coding that stands for every coding a field does not name.
pub(crate) const ACCEPT_ENCODING_WILDCARD: &str = "*";

/// The parameter name that carries the relative quality of a coding.
pub(crate) const ACCEPT_ENCODING_QUALITY: &str = "q";

/// The quality (scaled by 1000) a coding counts as when no `q` parameter is present.
pub(crate) const DEFAULT_QUALITY_MILLI: u16 = 1000;

/// Maximum decompressed output size permitted per decode call to defend against decompression bombs.
pub(crate) const MAX_DECOMPRESSED_BYTES: usize = 64 * 1024 * 1024;

/// ASCII digit `'0'` byte used when parsing RFC 9110 `Accept-Encoding` quality values.
pub(crate) const QVALUE_DIGIT_ZERO: u8 = b'0';

/// ASCII digit `'1'` byte used when parsing RFC 9110 `Accept-Encoding` quality values.
pub(crate) const QVALUE_DIGIT_ONE: u8 = b'1';

/// ASCII decimal point `'.'` byte used when parsing RFC 9110 `Accept-Encoding` quality values.
pub(crate) const QVALUE_DECIMAL_POINT: u8 = b'.';