Macros | Functions | Variables
b64.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/lib/slice/b64.h"
#include <stdint.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/slice/slice_refcount.h"
Include dependency graph for b64.cc:

Go to the source code of this file.

Macros

#define GRPC_BASE64_MULTILINE_LINE_LEN   76
 
#define GRPC_BASE64_MULTILINE_NUM_BLOCKS   (GRPC_BASE64_MULTILINE_LINE_LEN / 4)
 
#define GRPC_BASE64_PAD_BYTE   0x7F
 
#define GRPC_BASE64_PAD_CHAR   '='
 

Functions

static int decode_group (const unsigned char *codes, size_t num_codes, unsigned char *result, size_t *result_offset)
 
static void decode_one_char (const unsigned char *codes, unsigned char *result, size_t *result_offset)
 
static void decode_two_chars (const unsigned char *codes, unsigned char *result, size_t *result_offset)
 
grpc_slice grpc_base64_decode (const char *b64, int url_safe)
 
grpc_slice grpc_base64_decode_with_len (const char *b64, size_t b64_len, int url_safe)
 
char * grpc_base64_encode (const void *vdata, size_t data_size, int url_safe, int multiline)
 
void grpc_base64_encode_core (char *result, const void *vdata, size_t data_size, int url_safe, int multiline)
 
size_t grpc_base64_estimate_encoded_size (size_t data_size, int multiline)
 

Variables

static const int8_t base64_bytes []
 
static const char base64_url_safe_chars []
 
static const char base64_url_unsafe_chars []
 

Macro Definition Documentation

◆ GRPC_BASE64_MULTILINE_LINE_LEN

#define GRPC_BASE64_MULTILINE_LINE_LEN   76

Definition at line 54 of file b64.cc.

◆ GRPC_BASE64_MULTILINE_NUM_BLOCKS

#define GRPC_BASE64_MULTILINE_NUM_BLOCKS   (GRPC_BASE64_MULTILINE_LINE_LEN / 4)

Definition at line 55 of file b64.cc.

◆ GRPC_BASE64_PAD_BYTE

#define GRPC_BASE64_PAD_BYTE   0x7F

Definition at line 53 of file b64.cc.

◆ GRPC_BASE64_PAD_CHAR

#define GRPC_BASE64_PAD_CHAR   '='

Definition at line 52 of file b64.cc.

Function Documentation

◆ decode_group()

static int decode_group ( const unsigned char *  codes,
size_t  num_codes,
unsigned char *  result,
size_t *  result_offset 
)
static

Definition at line 146 of file b64.cc.

◆ decode_one_char()

static void decode_one_char ( const unsigned char *  codes,
unsigned char *  result,
size_t *  result_offset 
)
static

Definition at line 130 of file b64.cc.

◆ decode_two_chars()

static void decode_two_chars ( const unsigned char *  codes,
unsigned char *  result,
size_t *  result_offset 
)
static

Definition at line 137 of file b64.cc.

◆ grpc_base64_decode()

grpc_slice grpc_base64_decode ( const char *  b64,
int  url_safe 
)

Definition at line 126 of file b64.cc.

◆ grpc_base64_decode_with_len()

grpc_slice grpc_base64_decode_with_len ( const char *  b64,
size_t  b64_len,
int  url_safe 
)

Definition at line 191 of file b64.cc.

◆ grpc_base64_encode()

char* grpc_base64_encode ( const void *  vdata,
size_t  data_size,
int  url_safe,
int  multiline 
)

Definition at line 59 of file b64.cc.

◆ grpc_base64_encode_core()

void grpc_base64_encode_core ( char *  result,
const void *  vdata,
size_t  data_size,
int  url_safe,
int  multiline 
)

Definition at line 77 of file b64.cc.

◆ grpc_base64_estimate_encoded_size()

size_t grpc_base64_estimate_encoded_size ( size_t  data_size,
int  multiline 
)

Definition at line 68 of file b64.cc.

Variable Documentation

◆ base64_bytes

const int8_t base64_bytes[]
static
Initial value:
= {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 0x3E, -1, -1, -1, 0x3F,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, -1, -1,
-1, 0x7F, -1, -1, -1, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12,
0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, -1, -1, -1, -1, -1,
-1, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24,
0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,
0x31, 0x32, 0x33, -1, -1, -1, -1, -1}

Definition at line 34 of file b64.cc.

◆ base64_url_safe_chars

const char base64_url_safe_chars[]
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"

Definition at line 49 of file b64.cc.

◆ base64_url_unsafe_chars

const char base64_url_unsafe_chars[]
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

Definition at line 47 of file b64.cc.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:03