15 static const char cb64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
16 static const char cd64[] =
"|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$XYZ[\\]^_`abcdefghijklmnopq";
23 out[1] =
cb64[((
in[0] & 0x03) << 4) | ((
len > 1) ? ((
in[1] & 0xf0) >> 4) : 0)];
24 out[2] = (
len > 1 ?
cb64[((
in[1] & 0x0f) << 2) | (
len > 2 ? ((
in[2] & 0xc0) >> 6) : 0)] :
'=');
31 for (
i = 0;
i < 4;
i++) {
32 if (
in[
i] < 43 ||
in[
i] > 122) {
42 out[0] =
v[0] << 2 |
v[1] >> 4;
43 out[1] =
v[1] << 4 |
v[2] >> 2;
44 out[2] = ((
v[2] << 6) & 0xc0) |
v[3];
86 (sz -
in) > 3 ? 3 : sz -
in);
97 const size_t osz = (sz * 4) + 2;
const lzma_allocator const uint8_t * in
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API void Ht_() free(HtName_(Ht) *ht)
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
#define rz_return_val_if_fail(expr, val)
static int local_b64_decode(const char in[4], ut8 out[3])
RZ_API size_t rz_base64_encode(char *bout, const ut8 *bin, size_t sz)
RZ_API char * rz_base64_encode_dyn(const ut8 *bin, size_t sz)
static void local_b64_encode(const ut8 in[3], char out[4], int len)
RZ_API ut8 * rz_base64_decode_dyn(const char *in, int len)
RZ_API int rz_base64_decode(ut8 *bout, const char *bin, int len)