libgpac
Documentation of the core library of GPAC
base_encoding.c File Reference
#include <gpac/base_coding.h>
#include <gpac/constants.h>
#include <zlib.h>
+ Include dependency graph for base_encoding.c:

Macros

#define char64(c)   ((c > 127) ? (char) 0xff : index_64[(c)])
 
#define char16(nb)   (((nb) < 97) ? ((nb)-48) : ((nb)-87))
 
#define ZLIB_COMPRESS_SAFE   4
 

Functions

GF_EXPORT u32 gf_base64_encode (const u8 *_in, u32 inSize, u8 *_out, u32 outSize)
 base64 encoder More...
 
u32 load_block (char *in, u32 size, u32 pos, char *out)
 
GF_EXPORT u32 gf_base64_decode (u8 *in_buf, u32 inSize, u8 *out, u32 outSize)
 base64 decoder More...
 
GF_EXPORT u32 gf_base16_encode (u8 *_in, u32 inSize, u8 *_out, u32 outSize)
 base16 encoder More...
 
GF_EXPORT u32 gf_base16_decode (u8 *in, u32 inSize, u8 *out, u32 outSize)
 base16 decoder More...
 
GF_EXPORT GF_Err gf_gz_compress_payload_ex (u8 **data, u32 data_len, u32 *max_size, u8 data_offset, Bool skip_if_larger, u8 **out_comp_data, Bool use_gz)
 
GF_EXPORT GF_Err gf_gz_compress_payload (u8 **data, u32 data_len, u32 *max_size)
 
GF_EXPORT GF_Err gf_gz_decompress_payload_ex (u8 *data, u32 data_len, u8 **uncompressed_data, u32 *out_size, Bool use_gz)
 
GF_EXPORT GF_Err gf_gz_decompress_payload (u8 *data, u32 data_len, u8 **uncompressed_data, u32 *out_size)
 
GF_EXPORT GF_Err gf_lz_decompress_payload (u8 *data, u32 data_len, u8 **uncompressed_data, u32 *out_size)
 
GF_EXPORT GF_Err gf_lz_compress_payload (u8 **data, u32 data_len, u32 *max_size)
 

Variables

static const char base_64 [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
 
static const unsigned char index_64 [128]
 
static const char base_16 [] = "0123456789abcdef"
 

Macro Definition Documentation

◆ char64

#define char64 (   c)    ((c > 127) ? (char) 0xff : index_64[(c)])

◆ char16

#define char16 (   nb)    (((nb) < 97) ? ((nb)-48) : ((nb)-87))

◆ ZLIB_COMPRESS_SAFE

#define ZLIB_COMPRESS_SAFE   4

Function Documentation

◆ load_block()

u32 load_block ( char *  in,
u32  size,
u32  pos,
char *  out 
)
+ Here is the caller graph for this function:

Variable Documentation

◆ base_64

const char base_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
static

◆ index_64

const unsigned char index_64[128]
static
Initial value:
= {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 62, 0xff, 0xff, 0xff, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0xff, 0xff, 0xff, 0xff, 0xff
}

◆ base_16

const char base_16[] = "0123456789abcdef"
static