This C compatible library provides functions for implementing yEnc where speed is important.
Note that it only handles the underlying encoding/decoding routines - yEnc headers aren’t handled.
A build file/project can be created using CMake.
mkdir build
cd build
cmake ..
cmake --build . --config Release
After compilation, a shared and static library should be generated, as well as a benchmark and sample CLI application.
The following options can be passed into CMake:
rapidyenc_encode
* functions, except rapidyenc_encode_max_length
, will be unavailablerapidyenc_decode
* functions will be unavailablerapidyenc_crc
functions will be unavailable. Implies DISABLE_CRCUTIL*Before any encoding/decoding/CRC functions can be used, the respective _init
function must be called. These functions set up the necessary state for computation. Note that _init
functions aren’t thread-safe, but all others are.
Functions documented in the header file.
cli.c is a simple command-line application which encodes/decodes stdin to stdout. It demonstrates how to do incremental encoding/decoding/CRC32 using this library.
A brief description of how the SIMD yEnc encoding algorithm works can be found here. I may eventually write up something more detailed, regarding optimizations and such used.
This module is Public Domain or CC0 (or equivalent) if PD isn’t recognised.
crcutil, used for CRC32 calculation, is licensed under the Apache License 2.0
zlib-ng, from where the CRC32 calculation using folding approach was stolen, is under a zlib license