zxc

Bindings to ZXC compression library

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.0
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-09-04 07:26

Authors

  • George Lemon

Installation

nimble install zxc
choosenim install zxc
git clone https://github.com/openpeeps/zxc-nim

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
zxc - - - - - - -

Dependencies

Package Version Optional
nim >= 2.0.0 No

Source

Repository https://github.com/openpeeps/zxc-nim
Homepage https://github.com/openpeeps/zxc-nim
Registry Source nimble_official

README

Bindings to the ZXC compression library
A LZ77-based compressor optimized for high decompression speed

nimble install zxc

API reference
Github Actions Github Actions

😍 Key Features

  • Write-Once, Read-Many compression
  • Optimized for Game Assets, Firmware & App Bundles
  • High decompression speed
  • Stream API for compressing/decompressing large data
  • Multi-threaded Streaming API for even faster performance
  • Optional Checksum Validation
  • Level-based compression (Fastest, Fast, Default, Balanced and Compact)
  • Reusable contexts for high-frequency call sites
  • Seekable archives (Optional seek table for O(1) random access)

Installation

Use your favorite package manager to install the ZXC library, or build it from source.

Examples

Compressing and decompressing strings with mutable buffers

let original = "The quick brown fox jumps over the lazy dog 🦊"
var compressed: CompZscBytes # seq[byte]
compressBytes(original, compressed, ZXC_LEVEL_DEFAULT, false)

var decompressed: DecompZscBytes # seq[byte]
decompressBytes(compressed, decompressed, false)
assert decompressed.bytesToString == original

Use ZXC's streaming API for large data or when you want to enjoy multi-threaded performance

let testFile = "test_zxc_input.txt"
let compressedFile = "test_zxc_input.txt.zxc"
let decompressedFile = "test_zxc_input_out.txt"
let content = "ZXC file streaming test!\nLine 2.\nLine 3."

compressFile(testFile, compressedFile, level = ZXC_LEVEL_DEFAULT, checksumEnabled = true)
decompressFile(compressedFile, decompressedFile, checksumEnabled = true)

assert readFile(decompressedFile) == content

Check more examples in the tests directory

todo: example with reusable contexts and seekable archives

❤ Contributions & Support

🎩 License

BSD-3-Clause license. Made by Humans from OpenPeeps.
Copyright OpenPeeps & Contributors — All rights reserved.