github hellobertrand/zxc v0.8.0
ZXC v0.8.0

latest releases: v0.10.0, v0.9.1, v0.9.0...
one month ago

Release Notes

This release brings significant improvements to the ZXC ecosystem, focusing on security, performance, cross-language support, and comprehensive documentation.

Breaking Changes (Format Version 5)

  • Format V5: Implemented an LZ offset bias (+1) at the format level to eliminate potential zero-offset attack vectors.
  • Checksums: Header checksums now use Marsaglia xorshift algorithm.

Performance Improvements

The new LZ77 hashing strategy and hash table configuration optimizations (#106) yield significant performance gains across different architectures, especially for higher compression levels.

Highlights:

  • Compression Speed: Massive improvements for levels 3 to 5, showing 33% to 43% faster compression speeds on both x86_64 and ARM64 architectures.
  • Decompression Speed: Notable improvements for faster levels (1 and 2), with up to 10-18% speedup on x86_64 and ~8-10% on ARM64.
  • Compression Ratio: Ratios are maintained or slightly improved, meaning these speed gains come at no cost to compression size.

Changes

Performance & Refactoring

  • Hashing Optimization: Optimized the LZ77 hashing strategy and standardized hash table configuration for improved compression efficiency (#106).
  • Enhanced Error Handling: Refactored error handling with robust error codes. The Python wrapper now exposes these C error constants to provide enhanced and native error reporting (#103, #111).
  • Dual-Scale Chunk Size Implementation: The ZXC_BLOCK_SIZE is no longer limited to 1 MB. The ZXC file format now formally supports block sizes up to 8 MB. Introduced a Most Significant Bit (MSB) dual-scale flag in Chunk Size Code.
    Fine Scale (MSB=0): Uses a 4 KB multiplier, enabling block sizes from 4 KB to 508 KB.
    Large Scale (MSB=1): Uses a 64 KB multiplier, unlocking block sizes from 64 KB up to 8 MB.
  • CLI: Adds multiple file processing mode. Introduces the -m or --multiple CLI option, enabling the processing of several input files in a single command. Each file is handled independently, with output filenames automatically derived from the input (e.g., file.txt compresses to file.txt.xc, file.txt.xc decompresses to file.txt).
  • CLI: Adds recursive directory processing mode. Introduces the -r or --recursive CLI option, enabling the processing of all regular files within specified directories and their subdirectories.

Security & Stability

  • Zero-Offset Attack Prevention: Implemented an LZ offset bias (+1) at the format level to eliminate potential zero-offset attack vectors (#104).
  • Memory Safety: Fixed potential buffer overflows, decoder underflows, and path handling edge cases (#105).
  • Code Quality: Enforced strict const correctness for local variables to ensure better compile-time safety (#110).
  • CLI: Fixes benchmark deadline calculation. Explicitly casts when calculating compression and decompression benchmark deadlines.
  • CLI: Refactors path handling for robustness (#119). Addresses compatibility issues arising from reliance on PATH_MAX fixed-size buffers.
  • Migrates internal path manipulation in validation and directory processing to use dynamic memory allocation with realpath(NULL), strdup, and malloc. This ensures adaptability to varying path lengths and improves compatibility on systems where PATH_MAX may be undefined or insufficient, such as GNU/Hurd.
  • Adds CI support for Alpha architecture (#122)

Wrappers

  • Node.js Support: Introduced a brand-new Node.js wrapper for zxc compression, expanding our language ecosystem (#107).
  • Python: Closes file handles in stream tests (#115). Prevents potential resource leaks by guaranteeing cleanup via a finally block, regardless of test success or failure.

Documentation & Ecosystem

  • Format Specification: Published a comprehensive ZXC file format specification featuring byte-level structures and a worked hexdump example.
  • MAN: Provides comprehensive documentation for the zxc command-line interface man.
  • Added vcpkg installation instructions, refined the introduction, and added a TL;DR and new package badges to the README.

Full Changelog: v0.7.3...v0.8.0

Don't miss a new zxc release

NewReleases is sending notifications on new releases.