nimlz4

Nim wrapper for the LZ4 library

Wrapper score 15/100 · tests present · no docs generated

Wraps a native library — check OS Compatibility below for platform-specific linking notes.

Summary

Latest Version 0.1.0
License BSD-3
CI Status Failing
Downloads 0
Last Indexed 2026-08-31 07:14

Authors

  • Didier Deshommes

Installation

nimble install nimlz4
choosenim install nimlz4
git clone https://github.com/dfdeshom/nimlz4.git

OS Compatibility

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

Source

Repository https://github.com/dfdeshom/nimlz4.git
Homepage https://github.com/dfdeshom/nimlz4
Registry Source nimble_official

README

nimlz4

Nim wrapper for LZ4

Simple compression (block API)

Use this API when you don't care about interoperability and assume only this wrapper will be used to compress and decompress strings:

import lz4
var input = readFile("LICENSE")
var compressed = compress(input,level=1)
var uncompressed = uncompress(compressed)
echo(uncompressed==input)

If you would like a better compression ratio at the expense of CPU time, use compress_more().

Frame compression (auto-framing API)

Use the frame API when you want your compressed data to be decompressable by other programs.

import lz4
var prefs = newLZ4F_preferences()
var compressed = compress_frame(input,prefs)
var decompressed = uncompress_frame(compressed)
echo(input == decompressed)