JWT-CPP v0.7.2
A header only library for creating and validating JSON Web Tokens (JWT) in C++
Loading...
Searching...
No Matches
jwt::base Namespace Reference

A collection of fellable functions for working with base64 and base64url. More...

Functions

template<typename T>
std::string encode (const std::string &bin)
 Generic base64 encoding.
template<typename T>
std::string decode (const std::string &base)
 Generic base64 decoding.
template<typename T>
std::string pad (const std::string &base)
 Generic base64 padding.
template<typename T>
std::string trim (const std::string &base)
 Generic base64 trimming.

Detailed Description

A collection of fellable functions for working with base64 and base64url.

Function Documentation

◆ decode()

template<typename T>
std::string jwt::base::decode ( const std::string & base)

Generic base64 decoding.

A Generic base64 decoding function that supports any "alphabet" such as jwt::alphabet::base64

const auto b64 = jwt::base::decode<jwt::alphabet::base64>("ZXhhbXBsZV9kYXRh")
std::string decode(const std::string &base)
Generic base64 decoding.
Definition base.h:322

◆ encode()

template<typename T>
std::string jwt::base::encode ( const std::string & bin)

Generic base64 encoding.

A Generic base64 encode function that supports any "alphabet" such as jwt::alphabet::base64

const auto b64 = jwt::base::encode<jwt::alphabet::base64>("example_data")
std::string encode(const std::string &bin)
Generic base64 encoding.
Definition base.h:308

◆ pad()

template<typename T>
std::string jwt::base::pad ( const std::string & base)

Generic base64 padding.

A Generic base64 pad function that supports any "alphabet" such as jwt::alphabet::base64

const auto b64 = jwt::base::pad<jwt::alphabet::base64>("ZXhhbXBsZV9kYQ")
std::string pad(const std::string &base)
Generic base64 padding.
Definition base.h:336

◆ trim()

template<typename T>
std::string jwt::base::trim ( const std::string & base)

Generic base64 trimming.

A Generic base64 trim function that supports any "alphabet" such as jwt::alphabet::base64

const auto b64 = jwt::base::trim<jwt::alphabet::base64>("ZXhhbXBsZV9kYQ==")
std::string trim(const std::string &base)
Generic base64 trimming.
Definition base.h:350