Revision history for Compression-Util 0.16 2026-03-31 [IMPROVEMENTS] - Better performance in `bwt_sort()` for certain inputs. (~2x faster) - Better performance in `bwt_decode()`, `huffman_decode()` and `huffman_from_freq()`. - Better performance in `lzss_decode()`. 0.15 2025-04-03 [BUG-FIXES] - Set the appropriate DEFLATE values inside the `deflate_*` functions. 0.14 2024-11-06 [ADDITIONS] - Added the `adler32()` checksum function. - Added the `zlib_compress()` and `zlib_uncompress()` functions. - Added the following low-level functions: deflate_create_block_type_0_header deflate_create_block_type_1 deflate_create_block_type_2 deflate_extract_next_block deflate_extract_block_type_0 deflate_extract_block_type_1 deflate_extract_block_type_2 0.13 2024-08-25 [IMPROVEMENTS] - More Gzip flags are now recognized. - Better compression ratio in bzip2_compress(). [BUG-FIXES] - Fixed the extraction of Gzip data that contains a comment. - Fixed a potential CRC32 issue in bzip2_compress() when data gets expanded. 0.12 2024-08-23 [ADDITIONS] - Added the `lz4_compress()` and `lz4_decompress()` functions. [IMPROVEMENTS] - Slightly better performance in `mtf_encode()`. - Replaced all "die" statements, with Carp::confess(), for better debugging. [BUG-FIXES] - Allow `$LZ77_MIN_LEN` to be set by the user to a value greater than 4, before calling `gzip_compress()`. 0.11 2024-08-22 [ADDITIONS] - Added the `crc32()` function. - Added the `int2bytes()` and `int2bytes_lsb()` functions. - Added the `bzip2_compress()` and `bzip2_decompress()` functions. - Added the `gzip_compress()` and `gzip_decompress()` functions. - Added the `encode_alphabet_256()` and `decode_alphabet_256()` functions. [IMPROVEMENTS] - Minor documentation improvements. - Slightly more efficient encoding of the alphabet, in function `encode_alphabet()`. [CHANGES] - Changed the default value of `$Compression::Util::LZ_MAX_LEN` from 258 to 32768. For some inputs, this results in better compression at no additional costs. 0.10 2024-08-07 [ADDITIONS] - Added the `mrl_compress()` and `mrl_decompress()` functions, for compressing/decompressing strings. - Added the `bytes2int()` and `bytes2int_lsb()` functions. [CHANGES] - Changed the order of values returned by `lz77_encode()`. - Changed the order of arguments accepted by `lz77_decode()`. [FIXES] - Fixed an issue in `lzb_decompress($fh)`, when there is more data after the LZB block. 0.09 2024-06-26 - Generalized `make_deflate_tables()` to generate tables for arbitrarily large distances and match lengths. - Generalized `deflate_encode()` to encode arbitrarily large distances and arbitrarily large match lengths. - Better compression ratio when `$LZ_MAX_DIST` is set to a small value. - Minor documentation and performance improvements. 0.08 2024-06-03 [ADDITIONS] - Added the `lzb_compress()` and `lzb_decompress()` functions. - Added the `lzss_encode_symbolic()` and `lzss_decode_symbolic()` functions. - Added the `lzss_compress_symbolic()` and `lzss_decompress_symbolic()` functions. - Added the `$LZ_MAX_DIST` variable, which controls the maximum backreference allowed in LZ parsing. [IMPROVEMENTS] - Better compression ratio in `lz77_compress()`. [CHANGES] - Renamed `bz2_compress` and `bz2_decompress` to `bwt_compress` and `bwt_decompress`, respectively. - Renamed `$LZSS_MIN_LEN` to `$LZ_MIN_LEN`. - Renamed `$LZSS_MAX_LEN` to `$LZ_MAX_LEN`. - Removed the `$LZ77_MIN_LEN` and `$LZ77_MAX_LEN` variables. Using `$LZ_MIN_LEN` and `$LZ_MAX_LEN` instead. 0.07 2024-05-12 - Use the value of `$LZ_MAX_CHAIN_LEN` in `lz77_encode_symbolic()` as well. - Added the following package variables: $Compression::Util::LZSS_MIN_LEN $Compression::Util::LZSS_MAX_LEN $Compression::Util::LZ77_MIN_LEN $Compression::Util::LZ77_MAX_LEN ...which control the minimum and maximum lenght of a match in LZSS/lZ77 encoding. - Added support for exporting package variables with `use Compression::Util qw($PACKAGE_VARIABLE)`. 0.06 2024-05-05 [ADDITIONS] - Added the lzss_encode_fast() function. - Added the lz77_compress_symbolic() and lz77_decompress_symbolic() functions. [IMPROVEMENTS] - Much faster algorithm in lzss_encode() for large enough strings. - Much better compression ratios achived by lzss_encode(). - Extended lzss_compress() to accept an additional optional argument, specifying the LZSS encoding method. [CHANGES] - Removed the lzhd_compress() and lzhd_decompress() functions. - Renamed the mrl_compress() and mrl_decompress() to mrl_compress_symbolic() and mrl_decompress_symbolic(), respectively. - Simplified all functions to no longer take an optional output filehandle. [BUG-FIXES] - The output of delta_encode() is now always deterministic. 0.05 2024-04-13 [ADDITIONS] - Added the mrl_compress() and mrl_decompress() functions. - Added the read_bit_lsb(), read_bits_lsb(), int2bits(), int2bits_lsb(), bits2int() and bits2int_lsb() functions. - Added the read_null_terminated() function. - Added the string2symbols() and symbols2string() functions. [IMPROVEMENTS] - Extended `huffman_from_*` to check the context and return only the encoding dictionary in scalar context. [CHANGES] - Simplified `lzss_encode()` for better performance, with a minimal impact on compression ratio. [BUG-FIXES] - Fixed several special cases and added more tests. 0.04 2024-04-06 [ADDITIONS] - Added the deltas() and its inverse, accumulate(), functions. - Added the frequencies() function. - Added the huffman_from_symbols() function. - Added the huffman_from_code_lengths() function. [CHANGES] - Simplified deflate_encode() to always return a binary string (no longer writes to a file-handle). - Improved the delta_encode() function to also use RLE when it's beneficial. - Renamed huffman_tree_from_freq() to huffman_from_freq(). 0.03 2024-03-22 [ADDITIONS] - Added the lzhd_compress() and lzhd_decompress() functions. - Added the obh_encode() and obh_decode() functions. [CHANGES] - Simplified deflate_encode() to no longer require the size of the uncompressed data. 0.02 2024-03-21 [ADDITIONS] - Added the run_length() function. - Added the binary_vrl_encode() and binary_vrl_decode() functions. - Added the elias_gamma_encode() and elias_gamma_decode() functions. - Added the adaptive_ac_encode() and adaptive_ac_decode() functions. - Added the create_adaptive_ac_entry() and decode_adaptive_ac_entry() functions. [CHANGES] - Renamed mtf_encode_alphabet() to encode_alphabet(). - Renamed mtf_decode_alphabet() to decode_alphabet(). 0.01 2024-03-21 - Initial release.