Skip to content

Instantly share code, notes, and snippets.

View cppservergit's full-sized avatar

CPPServer cppservergit

View GitHub Profile
@darelf
darelf / base64.cpp
Last active August 28, 2023 17:44
Base64 url encode/decode. C++ adapted from some old code by someone else...
#include <string>
#include <vector>
/*
Base64 translates 24 bits into 4 ASCII characters at a time. First,
3 8-bit bytes are treated as 4 6-bit groups. Those 4 groups are
translated into ASCII characters. That is, each 6-bit number is treated
as an index into the ASCII character array.
If the final set of bits is less 8 or 16 instead of 24, traditional base64