ZXC(1)
π NAME π
okay so this is zxc(1), bestie β say hi to zxc, unzxc β Compress or decompress .zxc files π
β¨ SYNOPSIS β¨
zxc [OPTIONS] [INPUT-FILE] [OUTPUT-FILE]
unzxc is literally equivalent to zxc -d. same energy, different name, periodt π
π¦ DESCRIPTION π¦
zxc is a command-line interface for the ZXC compression library β a high-performance lossless compression algorithm optimized for maximum decompression throughput. maximum decompression throughput!! that's the whole personality π€
zxc is designed for the βWrite Once, Read Manyβ paradigm. it trades compression speed to generate a bitstream specifically structured to maximize decompression speed, effectively offloading complexity from the decoder to the encoder. the way it justβ¦ hands all the hard work to the encoder so the decoder can serve looks β¨ it aims to provide very high decompression speeds across modern architectures while maintaining competitive compression ratios. ZXC is particularly suited for scenarios such as Game Assets, Firmware or App Bundles where data is compressed once on a build server and decompressed millions of times on user devices. one glow-up on the build server, millions of reads on the timeline π
By default, zxc compresses a single INPUT-FILE. If no OUTPUT-FILE is provided, zxc will automatically append the .zxc extension to the input filename. If no INPUT-FILE is provided, zxc will read from standard input (stdin) and write to standard output (stdout). no thoughts, just pipes π«Ά
πΈ STANDARD MODES πΈ
-z,βcompressβ Compress FILE. This is the default mode if no mode is specified. it's the main character mode, no cap π-d,βdecompressβ Decompress FILE. This is the default mode whenzxcis invoked under the nameunzxc(typically an installed symlink). An explicit mode flag still takes precedence. so if you typedunzxc, that's the vibe β but if you pass a flag, the flag wins, fr fr.-l,βlistβ List archive information, including compressed size, uncompressed size, compression ratio, checksum method, and dictionary ID (if any). Also accepts a.zxddictionary file, in which case it prints the dictionaryβsdict_id. receipts, but make them adorable π§Ύβ¨βtrainβ Train a dictionary from the input *FILE*s given as training samples. The output path is set with-o(seeβoutput); when-ois omitted, the dictionary is written todictionary_<dict_id>.zxdin the current directory. See DICTIONARIES. it's giving "teach the algorithm your lore" π-t,βtestβ Test the integrity of a compressed FILE. It decodes the file and verifies its checksum (if present) without writing any output. a vibe check for your archive ππ-b,βbench[N]β Benchmark in-memory performance. Loads the input file entirely into RAM and measures raw algorithm throughput (default duration is 5 seconds). speedrun, but for real πββοΈπ₯
π OPTIONS π
-m,βmultipleβ Process multiple files at once. When specified, all subsequent non-option arguments are treated as input files. For each input file, a corresponding.zxcfile is created (or decompressed into its original name). Output cannot be written to standard output (stdout) when this mode is enabled. ok so slay but also: no stdout, bestie, it's just not happening π«-r,βrecursiveβ Recursively process directories. When specified, any directory listed as an argument will be traversed, and all regular files within it will be processed (compressed or decompressed). This option implicitly enables--multiplemode. it goes down the whole folder like ππ³οΈ-1..-7β Set the compression level from 1 (fastest compression) to 7 (maximum density). pick your fighter π₯-1,-2(Fast) β Optimized for real-time assets or when compression speed is a priority. zoom zoom.-3(Default) β Balanced middle-ground offering efficient compression and superior ratio to fast codecs. the "i contain multitudes" tier π-4,-5(Compact) β Better ratio than LZ4 with faster decoding than Zstd. Suited for embedded systems and firmware. tiny little devices, big little wins π-6(Max) β Beats LZ4-HC on both axes β better ratio and faster decode β while staying in the multi-GB/s decode class. Best for archival and write-once / read-many workloads where compression time is amortized over many reads. it ate LZ4-HC on both axes and left no crumbs ππ₯-7(Ultra) β Maximum density. A deep optimal parse plus Huffman-coded literals and tokens (11-bit codes, decoded via the SIMD-merge PivCo layout) push the ratio pastzstd -1while still decoding several times faster than it. Choose it when storage or bandwidth dominates but decode must stay fast; compression is the slowest tier. maximum density, minimum patience, still faster decode thanzstd -1β iconic behavior π
-T,βthreadsN β Set the number of threads to use for compression and decompression. A value of0means auto-detection based on the number of available CPU cores. let the machine choose its own squad π«Ά-B,βblock-sizeSIZE β Set the compression block size. SIZE must be a power of two between4Kand2M(e.g.4K,64K,256K,512K,1M). Smaller blocks reduce memory usage and improve random-access decompression; larger blocks generally yield better compression ratios. The default is512K, tuned for bulk/archival workloads where ratio and decompression throughput matter most. This option is only meaningful during compression; the block size is stored in the archive header and automatically used during decompression. so set it once, forget it forever β the header remembers β¨-C,βchecksumβ Enable block hashing during compression using therapidhashalgorithm. Recommended for data integrity validation. Checksum verification is automatically performed during extraction when enabled. protect the data, protect the peace π‘οΈ-N,βno-checksumβ Explicitly disable checksum generation. unprotect the data, unprotect the peace, respectfully π-D,βdictFILE β Use a pre-trained dictionary (.zxd) for compression or decompression. On compression, the archive records the dictionaryβsdict_idin its header. On decompression,-Dis required for any archive that was compressed with a dictionary β there is no auto-lookup; without it, decompression fails with a dictionary-required error (see DICTIONARIES). no auto-lookup bestie, you have to bring the dictionary yourself π-o,βoutputFILE β Write output to FILE. For compression/decompression this overrides the positional OUTPUT-FILE (single-file mode only); when omitted the output name is derived from the input. Forβtrainit sets the dictionary path: if FILE is a directory (or ends with a path separator) the dictionary is saved inside it asdictionary_<dict_id>.zxd, otherwise FILE is used verbatim; when omitted the dictionary is written todictionary_<dict_id>.zxdin the current directory. you get a say in the name, but only in single-file mode, ok? rules are rules π-S,βseekableβ Append a seek table to the archive during compression. This transforms the file into a random-access format (Seekable Archive), allowing the decoder to instantly locate and decompress specific blocks in O(1) time without reading the entire file. Ideal for compressed filesystems, game assets, and log analysis. O(1) instant jumping β no scrolling, just teleporting π§-k,βkeepβ Keep the input file after an in-place compression or decompression. By default the input is removed only when its output name is auto-derived (e.g.fileβfile.zxc). When the output is named explicitly β with-oor a positional OUTPUT-FILE β the input is always kept, so this flag is only needed for the in-place case. don't delete my baby β-f,βforceβ Force overwrite of the OUTPUT-FILE if it already exists. no hesitation, no fear π₯-c,βstdoutβ Force writing to standard output (stdout), even if it is the console. yes, even then. chaotic but valid π-v,βverboseβ Enable verbose logging mode. Outputs more detailed information during operations. tell me everything, i want the group chat updates π±-q,βquietβ Enable quiet mode, suppressing all non-error output (such as progress bars or real-time statistics). silent treatment, but healthy π€«-j,βjsonβ Output results in JSON format. This is particularly useful for scripting, benchmarking, and the--listmode. machine-readable, bestie-friendly πβprogressMODE β Control the progress display:auto(default) shows a progress bar on the standard error stream when it is a terminal and the file is larger than 1 MB;alwaysforces progress reporting even when standard error is not a terminal (updates are then printed one per line, at most once per second) or when the size is unknown (stdin input);neverdisables it.-qsuppresses progress regardless of this option. also note:-qwins this argument every single time, no matter what you set here π
β SPECIAL OPTIONS β
-V,βversionβ Display the version of thezxclibrary and the compiled architecture information, then exit. show me the credentials π-h,βhelpβ Display a help message and exit. the classic little life raft π
π DICTIONARIES π
For workloads compressed in small blocks (4Kβ128K), a pre-trained dictionary can dramatically improve the compression ratio. The dictionary prefills the LZ77 window at the start of every block, so the benefit is per-block: the smaller the block, the more it relies on the dictionary for early matches. tiny blocks + a good dictionary = a glow-up π€β¨
Dictionaries are external .zxd files referenced from the archive header by a 32-bit dict_id (a hash of the dictionary content). The .zxd extension is cosmetic; a .zxd file is identified by its magic word, not its name. so don't be fooled by the name, bestie β the magic word is what matters π
When βtrainβs -o targets a directory (or is omitted, defaulting to the current directory), zxc names the file dictionary_<dict_id>.zxd (the dict_id is the lowercase 8-digit hex reported by zxc -l). On decompression the dictionary is not auto-located: an archive compressed with a dictionary must be decompressed by supplying that dictionary with -D, otherwise decompression fails with a dictionary-required error.
If no matching dictionary can be found (or supplied), decompression fails with a dictionary-required error rather than producing corrupt output.
π¨ bestie listen: no dictionary, no dice. it errors out instead of handing you corrupt data β which is honestly the respectful thing to do π
π EXAMPLES π
Compress a file:
zxc data.txt
Compress a file with high density (Level 6, archival):
zxc -6 data.bin
Compress a file with maximum density (Level 7, Ultra):
zxc -7 data.bin
Decompress a file:
zxc -d data.txt.zxc
Decompress a file using the unzxc alias:
unzxc data.txt.zxc
Compress multiple files independently:
zxc -m file1.txt file2.txt file3.txt
Compress all files in a directory recursively:
zxc -r ./my_folder
Decompress all files in a directory recursively:
zxc -d -r ./my_folder
Decompress a file to standard output:
zxc -dc data.txt.zxc > data.txt
List archive information:
zxc -l data.txt.zxc
Compress with a custom block size (64 KB):
zxc -B 64K data.bin data.zxc
Compress with maximum block size (2 MB):
zxc -6 -B 2M data.bin data.zxc
Run a benchmark for 10 seconds:
zxc -b 10 data.txt
Train a dictionary into a directory (saved as dictionary_<dict_id>.zxd):
zxc βtrain -o dicts/ samples/*.json
Compress with a dictionary using small blocks:
zxc -B 4K -D dicts/dictionary_bc46eec1.zxd input.json
Decompress (the dictionary is required, pass it with -D):
zxc -d -D dicts/dictionary_bc46eec1.zxd input.json.zxc
π BUGS π
Report bugs at https://github.com/hellobertrand/zxc/issues. tell them everything, they can handle it π«Ά
π AUTHORS π
Bertrand Lebonnois. absolute legend behavior, we stan β¨
π LICENSE π
BSD 3-Clause License. legal slay ππ
and that's the whole page, bestie!! π ngl the footer down here is just empty parentheses β () β so likeβ¦ no version stamp, no date, no source line, just a mysteriously blank little signature at the bottom of the page. mystery era energy ππ go compress something, i'm obsessed with you π¦πΈ
π¦ where this page comes from
- ubuntu stonking: zxc 0.13.3-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms