How google/brotli works
Project type and purpose
• This is an open-source, multi-language compression library implementing the Brotli algorithm (RFC 7932).
• It provides a high-performance core in C (encode/decode), a command-line tool, fuzz & research harnesses, and language bindings (C#, Java, Go, JS, Python).
File structure
• Top-level:
• BUILD.bazel, CMakeLists.txt, scripts/ → build & install (Bazel, CMake, scripts for pkgconfig)
• c/ → core C implementation, subdivided into common/, enc/, dec/
• c/include/brotli/ → public C API headers
• c/tools/ → brotli CLI tool based on the core
• c/fuzz/ → fuzzing harness targeting the C core
• research/ → experimental tools, dumps, generators
• {csharp, java, go, js, python}/ → language wrappers & pure-language ports
• tests/ → compatibility & round-trip tests for the C core and testdata
• Each language folder contains its own BUILD/MODULE files (Bazel), tests, and binding code.
README
• Confirms Brotli’s algorithmic building blocks (LZ77 variant, Huffman, context modeling).
• Lists build instructions (vcpkg, Bazel, CMake, pip).