inikep / lizard

Lizard (formerly LZ5) is an efficient compressor with very fast decompression. It achieves compression ratio that is comparable to zip/zlib and zstd/brotli (at low and medium compression levels) at decompression speed of 1000 MB/s and faster.
Other
644 stars 40 forks source link

Documentation is non-existent #20

Open pps83 opened 5 years ago

pps83 commented 5 years ago

It should be quite obvious for first time users to see some simplest APIs (to compress/uncompress buffer without dealing with any file io). Strangely, lizard has links to file format, but no clues to basic api use (is it in examples, which one is the "hello world"?. I've been using zlib for more than a decade, and I've never needed to know its file format, perhaps same for 90% of its users.

IMO, it should be on the main page to see how to use the library.

ArlexDu commented 5 years ago

After making this project, I get the basic APIs... Lizard command line interface 64-bit 1.0.0 by Y.Collet & P.Skibinski (Jun 17 2019) Usage : lizard [arg] [input] [output]

input : a filename with no FILE, or when FILE is - or stdin, read standard input Arguments : -10...-19 : compression method fastLZ4 = 16-bit bytewise codewords higher number == more compression but slower -20...-29 : compression method LIZv1 = 24-bit bytewise codewords -30...-39 : compression method fastLZ4 + Huffman -40...-49 : compression method LIZv1 + Huffman -d : decompression (default for .liz extension) -z : force compression -f : overwrite output without prompting --rm : remove source file(s) after successful de/compression -h/-H : display help/long help and exit

Advanced arguments : -V : display Version number and exit -v : verbose mode -q : suppress warnings; specify twice to suppress errors too -c : force write to standard output, even if it is the console -t : test compressed file integrity -m : multiple input files (implies automatic output filenames) -r : operate recursively on directories (sets also -m) -B# : Block size [1-7] = 128KB, 256KB, 1MB, 4MB, 16MB, 64MB, 256MB (default : 4) -BD : Block dependency (improve compression ratio) --no-frame-crc : disable stream checksum (default:enabled) --content-size : compressed frame includes original size (default:not present) --[no-]sparse : sparse mode (default:enabled on file, disabled on stdout) Benchmark arguments : -b# : benchmark file(s), using # compression level (default : 1) -e# : test all compression levels from -bX to # (default : 1) -i# : minimum evaluation time in seconds (default : 3s) -B# : cut file into independent blocks of size # bytes [32+] or predefined block size [1-7] (default: 4)

inikep commented 4 years ago

There is an example program to demonstrate the basic usage of the compress/decompress functions at https://github.com/inikep/lizard/blob/lizard/examples/simple_buffer.c

The simplest API is:

LIZARDLIB_API int Lizard_compress (const char* src, char* dst, int srcSize, int maxDstSize, int compressionLevel); 
LIZARDDLIB_API int Lizard_decompress_safe (const char* source, char* dest, int compressedSize, int maxDecompressedSize);

More details about API in comments at: https://github.com/inikep/lizard/blob/lizard/lib/lizard_compress.h https://github.com/inikep/lizard/blob/lizard/lib/lizard_decompress.h