Goby3 3.5.0
2026.05.29
Loading...
Searching...
No Matches
jwt::base Namespace Reference

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

Namespaces

namespace  details
 

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")

Definition at line 322 of file base.h.

◆ 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")

Definition at line 308 of file base.h.

◆ 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")

Definition at line 336 of file base.h.

◆ 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==")

Definition at line 350 of file base.h.