Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@pimterry pimterry released this 12 Jul 16:25
· 10 commits to main since this release
e1a6e5a

Breaking changes

Streams API has changed significantly, streams no longer expose result() or last_input_offset() methods, and the compress() and decompress() methods return a result object, not just a buffer. Instead of querying state from the stream itself, you can now access it from the result, which exposes 3 properties:

  • buf - the output (the compressed/decompressed data.
  • code - the result code, corresponding to a value from brotli.BrotliStreamResultCode.
  • input_offset - the offset into the input stream that was read during this operation.

This resolves many issues with streams that could result in data corruption and processing failures. See the README for an updated example of how to use this with web streams.

The non-streaming API remains unchanged.