No description
Find a file
2015-12-28 20:58:55 -06:00
clz4 group low-level apis in own subdir 2015-12-28 20:47:56 -06:00
.gitignore Initial commit 2015-12-10 21:54:18 -06:00
LICENSE Initial commit 2015-12-10 21:54:18 -06:00
lz4.nim remove debug functions 2015-12-28 20:58:55 -06:00
nimlz4.nimble add .nimble file 2015-12-25 18:47:47 -06:00
README.md clarify wording 2015-12-22 22:49:51 -06:00
test.nim add high compression mode for LZ4 2015-12-22 22:47:44 -06:00

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)