yourWaifu / base65536

C++ constexpr implementation of qntm/base65536

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A C++ 17 implementation of qntm's base65536 that runs at compile time. With alternatives for C++ 11 and C++ 14 that runs at runtime.

Useage:

At compile time:

#include "base65536/base65536.h"

static constexpr char testInput[] = "Hello World";
constexpr auto test = Base65536::encode(testInput);
constexpr auto data = Base65536::decode(test);
static_assert(data.success);

runtime time:

#include "base65536/base65536.h"

const std::string testInput = "Hello World";
constexpr auto test = Base65536::encode(testInput);
bool fail = false; // use this to check for errors
constexpr auto data = Base65536::decode(test, fail);
if (fail) {}

About

C++ constexpr implementation of qntm/base65536

License:MIT License


Languages

Language:C++ 98.8%Language:CMake 1.2%