Unishox
A hybrid encoder for Short Unicode Strings
Loading...
Searching...
No Matches
Core API

Simple and Comprehensive APIs for compression/decompression. More...

Functions

int unishox2_compress_simple (const char *in, int len, char *out)
int unishox2_decompress_simple (const char *in, int len, char *out)
int unishox2_compress (const char *in, int len, char *out, int olen, const unsigned char usx_hcodes[], const unsigned char usx_hcode_lens[], const char *usx_freq_seq[], const char *usx_templates[])
int unishox2_decompress (const char *in, int len, char *out, int olen, const unsigned char usx_hcodes[], const unsigned char usx_hcode_lens[], const char *usx_freq_seq[], const char *usx_templates[])

Detailed Description

Simple and Comprehensive APIs for compression/decompression.

Function Documentation

◆ unishox2_compress()

int unishox2_compress ( const char * in,
int len,
char * out,
int olen,
const unsigned char usx_hcodes[],
const unsigned char usx_hcode_lens[],
const char * usx_freq_seq[],
const char * usx_templates[] )
extern

Comprehensive API for compressing a string

Presets are available for the last four parameters so they can be passed as single parameter.
See USX_PSET_* macros. Example call:
unishox2_compress(in, len, out, olen, USX_PSET_ALPHA_ONLY);

Parameters
[in]inInput ASCII / UTF-8 string
[in]lenlength in bytes
[out]outoutput buffer - should be large enough to hold compressed output
[in]olenlength of 'out' buffer in bytes. Can be omitted if sufficient buffer is provided
[in]usx_hcodesHorizontal codes (array of bytes). See macro section for samples.
[in]usx_hcode_lensLength of each element in usx_hcodes array
[in]usx_freq_seqFrequently occuring sequences. See USX_FREQ_SEQ_* macros for samples
[in]usx_templatesTemplates of frequently occuring patterns. See USX_TEMPLATES macro.

◆ unishox2_compress_simple()

int unishox2_compress_simple ( const char * in,
int len,
char * out )
extern

Simple API for compressing a string

Parameters
[in]inInput ASCII / UTF-8 string
[in]lenlength in bytes
[out]outoutput buffer - should be large enough to hold compressed output

◆ unishox2_decompress()

int unishox2_decompress ( const char * in,
int len,
char * out,
int olen,
const unsigned char usx_hcodes[],
const unsigned char usx_hcode_lens[],
const char * usx_freq_seq[],
const char * usx_templates[] )
extern

Comprehensive API for de-compressing a string

Presets are available for the last four parameters so they can be passed as single parameter.
See USX_PSET_* macros. Example call:
unishox2_decompress(in, len, out, olen, USX_PSET_ALPHA_ONLY);

Parameters
[in]inInput compressed bytes (output of unishox2_compress functions)
[in]lenlength of 'in' in bytes
[out]outoutput buffer - should be large enough to hold de-compressed output
[in]olenlength of 'out' buffer in bytes. Can be omitted if sufficient buffer is provided
[in]usx_hcodesHorizontal codes (array of bytes). See macro section for samples.
[in]usx_hcode_lensLength of each element in usx_hcodes array
[in]usx_freq_seqFrequently occuring sequences. See USX_FREQ_SEQ_* macros for samples
[in]usx_templatesTemplates of frequently occuring patterns. See USX_TEMPLATES macro.

◆ unishox2_decompress_simple()

int unishox2_decompress_simple ( const char * in,
int len,
char * out )
extern

Simple API for decompressing a string

Parameters
[in]inInput compressed bytes (output of unishox2_compress functions)
[in]lenlength of 'in' in bytes
[out]outoutput buffer for ASCII / UTF-8 string - should be large enough