wire / wire-format / brotli-format

Brotli compressed data format

Brotli is a compression format developed by Google, optimized for web content. A Brotli stream: window size (WBITS), then meta-blocks. Each meta-block: ISLAST (1 bit), ISUNCOMPRESSED (1 bit), optional data length (MLEN), then block data (literals with context modeling + backward references with a large window up to 16MB).

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: Brotli compressed data format

wire format

spec: RFC 7932

Brotli is a compression format developed by Google, optimized for web content. A Brotli stream: window size (WBITS), then meta-blocks. Each meta-block: ISLAST (1 bit), ISUNCOMPRESSED (1 bit), optional data length (MLEN), then block data (literals with context modeling + backward references with a large window up to 16MB).

fieldsizemeaning
WBITSvariableWindow size: 0-15 (16-17) or 16-30 (1MB-16MB window). Encoded as a variable-length code.
ISLAST1 bit1 if this is the last meta-block.
ISUNCOMPRESSED1 bit1 if the meta-block is stored uncompressed.
MNIBBLES2 bitsNumber of nibbles for MLEN (0 = no MLEN, 1-3 = 1-3 nibbles).
MLENvariableMeta-block data length (if MNIBBLES > 0).
Block datavariableLiterals (context-dependent Huffman) + backward references (distance + length, with a 120-entry static dictionary for common web terms).
Trailer0 bitsNo explicit trailer; the stream ends with ISLAST=1.

example:

06 00

Brotli: WBITS 16 (1MB window), empty stream (ISLAST=1, ISUNCOMPRESSED=0, MLEN=0)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/brotli-format or /wire-format/brotli-format.json