7#include <boost/test/unit_test.hpp>
12using namespace std::literals;
14BOOST_AUTO_TEST_SUITE(base32_tests)
18 static const std::string vstrIn[] = {
"",
"f",
"fo",
"foo",
"foob",
"fooba",
"foobar"};
19 static const std::string vstrOut[] = {
"",
"my======",
"mzxq====",
"mzxw6===",
"mzxw6yq=",
"mzxw6ytb",
"mzxw6ytboi======"};
20 static const std::string vstrOutNoPadding[] = {
"",
"my",
"mzxq",
"mzxw6",
"mzxw6yq",
"mzxw6ytb",
"mzxw6ytboi"};
21 for (
unsigned int i=0; i<std::size(vstrIn); i++)
29 BOOST_CHECK_MESSAGE(std::ranges::equal(*dec, vstrIn[i]), vstrOut[i]);
BOOST_AUTO_TEST_CASE(base32_testvectors)
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
std::optional< std::vector< unsigned char > > DecodeBase32(std::string_view str)
std::string EncodeBase32(Span< const unsigned char > input, bool pad)
Base32 encode.