A trimmed fork of andybalholm/brotli,
a pure-Go brotli compressor and decompressor translated from the reference
implementation (https://github.com/google/brotli) with the c2go tool at
https://github.com/andybalholm/c2go. All credit for the code goes to its
upstream authors; see LICENSE.
This fork exists for D2, which compiles to
WebAssembly. Upstream's http.go imports net/http, and importing a package
links its initialization (and much of crypto/x509, encoding/asn1 and
friends) into the WebAssembly module even though nothing calls it. This fork
keeps only what D2 uses:
NewReader,Reader(decoder)EncodeFast(one-shot quality 1 encoder with an 18-bit window)NewWriter,NewWriterLevel,NewWriterOptions,WriterOptions,Writerand the compression level constants (the encoder translated from C)
Removed from upstream v1.3.0:
http.go(HTTPCompressor,HTTPCompressorWithLevel)- the
matchfinderpackage,NewWriterV2,EncoderandFastEncoder - the
flatepackage and thecorpus-testcommand NewReaderOptionsandReaderOptions(large-window decoding)- the tests of the removed code, and with them the test dependency on
github.com/xyproto/randomstring SECURITY.md(report vulnerabilities in the code itself upstream)
The remaining code is unchanged from upstream apart from deleting unexported helpers that nothing calls any more. If you are not D2, use upstream.