DataReelDataReelC++ Toolkit Documentation

Base 64 Functions

Standard base 64 (RFC 4648) encoding and HTTP basic authentication helpers.

Contents

Overview
Functions

Overview

Base 64 is an encoding, not encryption. Use the TLS classes to protect data on the network.

Functions

std::string gxsBase64Encode(const void *data, std::size_t len)

Encodes binary data with = padding. An overload takes a std::string_view.

bool gxsBase64Decode(std::string_view s, std::string &out)

Decodes into out, which may hold binary data. White space is ignored. Returns false for input that is not valid base 64.

std::string gxsBasicAuthenticationEncode(std::string_view user, std::string_view passwd)

Returns "Basic " followed by base64(user:passwd).

bool gxsBasicAuthenticationDecode(std::string_view value, std::string &user, std::string &passwd)

Decodes an Authorization header value.