Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_lz4.h File Reference

LZ4 block-compression handler. More...

#include "n_str.h"
+ Include dependency graph for n_lz4.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

N_STRunzip4_nstr (N_STR *src)
 Return an uncompressed version of src produced by zip4_nstr.
 
N_STRzip4_nstr (N_STR *src)
 Return a compressed version of src using LZ4 block format.
 

Detailed Description

LZ4 block-compression handler.

Companion to n_zlib.h that wraps the lz4 reference implementation shipped under external/lz4/. Same self-framing layout as zip_nstr (u32 original size in network byte order + compressed payload), just a different codec inside. Picked when callers want speed over ratio, LZ4 compresses ~25x faster and decompresses ~10x faster than zlib at a ~25 % ratio cost on text / JSON payloads.

Author
Castagnier Mickael
Version
1.0
Date
23/04/2026

Definition in file n_lz4.h.