chromium/third_party/grpc/src/src/core/lib/slice/b64.cc

//
//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//

#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.h"

// --- Constants. ---

static const int8_t base64_bytes[] =;

static const char base64_url_unsafe_chars[] =;
static const char base64_url_safe_chars[] =;

#define GRPC_BASE64_PAD_CHAR
#define GRPC_BASE64_PAD_BYTE
#define GRPC_BASE64_MULTILINE_LINE_LEN
#define GRPC_BASE64_MULTILINE_NUM_BLOCKS

// --- base64 functions. ---

char* grpc_base64_encode(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) {}

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

grpc_slice grpc_base64_decode(const char* b64, int url_safe) {}

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) {}

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

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