The purpose of this small project is mainly educational. My intension was to use some C library with a help of emscripten compiler to port that libary to nodejs (javascript) environment.
Required tools for building project:
- emscripten compiler toolchain
- cmake as build tool
git clone https://github.com/sigidagi/weblzf
cd weblzf/build
./configure
make
It will generate two files: binary webassembly file: weblzf.wasm and JavaScript file: weblzf.js containing glue code to translate between the native C functions, and JavaScript/wasm. Check build folder: weblzf/build
LibLZF is a compression/decompression library by Marc Lehmann. It aims for very high speeds and reasonable compression. It could be widely used in everything from BigTable and other large data sets like MapReduce and Hierarchical Data Formats HDF5
Some performance comparision between different compression algorithms LZF vs LZO vs Snappy vs ZLIB.
index.html provides example javascript code how to access LZF compression/decompression library. Run webserver using python (or similar server of your choice) from project root directory:
python3 -m http.server
check console logs on web browser
firefox http://localhost:8000
by pressing [F12]
This code is under a BSD license. This essentially means you can freely use it as long as you include the copyright statements as attribution. See the license file for details.