YuBrotli brings the new Brotli compression algorithm to Delphi (Embarcadero, CodeGear, Borland).
Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. Its compression speed is similar with deflate but offers more dense compression with faster decompression.
The Brotli algorithm was developed by Google to speed up the Internet and has made its way into major web browsers like Chrome, Edge, Firefox, and Opera. Is is praised as the future of web compression.
The YuBrotli Delphi implementation requires no DLLs. YuBrotli is free to use without royalties. The YuBrotli Pascal Source Code is available for purchase.
YuBrotli usage is similar to Delphi's zlib usage. There are TStream compression / decompression wrappers as well as functions to compress / decompress streams, strings, and data in memory buffers.
Delphi TStream Brotli compression & decompression wrappers:
TBrotliCompressionStream
TBrotliDecompressionStream
Delphi TStream Brotli compression & decompression procedures:
BrotliCompressStream
BrotliDecompressStream
Delphi memory Brotli compression & decompression procedures:
BrotliCompress
BrotliDecompress
Delphi string Brotli compression & decompression functions:
BrotliCompressStr
BrotliDecompressStr
The YuBrotli interface includes the complete Brotli native API. This allows to target specific compression / decompression needs, for example by fine-tuning more options, setting up device-specific data handlers, and more.
Before each release, YuBrotli is tested to ensure it behaves as expected and is compatible with other Brotli implementations. This detected some bugs in the original Brotli C code, reported here:
All these bugs are fixed in YuBrotli.