7#include <boost/test/unit_test.hpp>
12using namespace std::literals;
14BOOST_AUTO_TEST_SUITE(base64_tests)
18 static const std::string vstrIn[] = {
"",
"f",
"fo",
"foo",
"foob",
"fooba",
"foobar"};
19 static const std::string vstrOut[] = {
"",
"Zg==",
"Zm8=",
"Zm9v",
"Zm9vYg==",
"Zm9vYmE=",
"Zm9vYmFy"};
20 for (
unsigned int i=0; i<std::size(vstrIn); i++)
26 BOOST_CHECK_MESSAGE(std::ranges::equal(*dec, vstrIn[i]), vstrOut[i]);
30 const std::vector<uint8_t> in_u{0xff, 0x01, 0xff};
31 const std::vector<std::byte> in_b{std::byte{0xff}, std::byte{0x01}, std::byte{0xff}};
32 const std::string in_s{
"\xff\x01\xff"};
33 const std::string out_exp{
"/wH/"};
BOOST_AUTO_TEST_CASE(base64_testvectors)
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
std::string EncodeBase64(Span< const unsigned char > input)
std::optional< std::vector< unsigned char > > DecodeBase64(std::string_view str)