Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
base64.cpp File Reference
#include "base64.h"
#include <iostream>
+ Include dependency graph for base64.cpp:

Functions

static bool is_base64 (unsigned char c)
 
bool base64_is_valid (std::string_view s)
 
std::string base64_encode (std::string_view s)
 
std::string base64_decode (std::string_view encoded_string)
 

Variables

static const std::string base64_chars
 
static const std::string base64_chars_padding_1 = "AEIMQUYcgkosw048"
 
static const std::string base64_chars_padding_2 = "AQgw"
 

Function Documentation

◆ base64_decode()

std::string base64_decode ( std::string_view encoded_string)

References base64_chars, and is_base64().

Referenced by decode_srp_verifier_and_salt(), ImageSource::generateImagePart(), Server::getMediaList(), Client::handleCommand_AnnounceMedia(), and ModApiUtil::l_decode_base64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ base64_encode()

std::string base64_encode ( std::string_view s)

References base64_chars.

Referenced by Server::addMediaFile(), encode_srp_verifier(), ModApiUtil::l_encode_base64(), and translate_password().

+ Here is the caller graph for this function:

◆ base64_is_valid()

bool base64_is_valid ( std::string_view s)

References base64_chars_padding_1, base64_chars_padding_2, and is_base64().

Referenced by decode_srp_verifier_and_salt(), ImageSource::generateImagePart(), Server::handleCommand_Init(), ModApiUtil::l_check_password_entry(), ModApiUtil::l_decode_base64(), and TestUtilities::testBase64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_base64()

static bool is_base64 ( unsigned char c)
inlinestatic

Referenced by base64_decode(), and base64_is_valid().

+ Here is the caller graph for this function:

Variable Documentation

◆ base64_chars

const std::string base64_chars
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/"

Referenced by base64_decode(), and base64_encode().

◆ base64_chars_padding_1

const std::string base64_chars_padding_1 = "AEIMQUYcgkosw048"
static

Referenced by base64_is_valid().

◆ base64_chars_padding_2

const std::string base64_chars_padding_2 = "AQgw"
static

Referenced by base64_is_valid().