chromium/third_party/webrtc/rtc_base/third_party/base64/base64.cc


//*********************************************************************
//* Base64 - a simple base64 encoder and decoder.
//*
//*     Copyright (c) 1999, Bob Withers - [email protected]
//*
//* This code may be freely used for any purpose, either personal
//* or commercial, provided the authors copyright notice remains
//* intact.
//*
//* Enhancements by Stanley Yamane:
//*     o reverse lookup table for the decode function
//*     o reserve string buffer space in advance
//*
//*********************************************************************

#include "rtc_base/third_party/base64/base64.h"

#include <string.h>

#include "absl/strings/string_view.h"
#include "rtc_base/checks.h"

vector;

namespace rtc {

static const char kPad =;
static const unsigned char pd =;  // Padding
static const unsigned char sp =;  // Whitespace
static const unsigned char il =;  // Illegal base64 character

const char Base64::Base64Table[] =// 0000000000111111111122222222223333333333444444444455555555556666
    // 0123456789012345678901234567890123456789012345678901234567890123
    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

// Decode Table gives the index of any valid base64 character in the
// Base64 table
// 65 == A, 97 == a, 48 == 0, 43 == +, 47 == /

const unsigned char Base64::DecodeTable[] =;

bool Base64::IsBase64Char(char ch) {}

bool Base64::GetNextBase64Char(char ch, char* next_ch) {}

bool Base64::IsBase64Encoded(absl::string_view str) {}

void Base64::EncodeFromArray(const void* data,
                             size_t len,
                             std::string* result) {}

size_t Base64::GetNextQuantum(DecodeFlags parse_flags,
                              bool illegal_pads,
                              const char* data,
                              size_t len,
                              size_t* dpos,
                              unsigned char qbuf[4],
                              bool* padded) {}

bool Base64::DecodeFromArray(const char* data,
                             size_t len,
                             DecodeFlags flags,
                             std::string* result,
                             size_t* data_used) {}

bool Base64::DecodeFromArray(const char* data,
                             size_t len,
                             DecodeFlags flags,
                             vector<char>* result,
                             size_t* data_used) {}

bool Base64::DecodeFromArray(const char* data,
                             size_t len,
                             DecodeFlags flags,
                             vector<uint8_t>* result,
                             size_t* data_used) {}

template <typename T>
bool Base64::DecodeFromArrayTemplate(const char* data,
                                     size_t len,
                                     DecodeFlags flags,
                                     T* result,
                                     size_t* data_used) {}

}  // namespace rtc