29#include <xrpl/basics/base64.h>
30#include <xrpl/beast/unit_test.h>
41 BEAST_EXPECT(encoded ==
out);
52 check(
"foob",
"Zm9vYg==");
53 check(
"fooba",
"Zm9vYmE=");
54 check(
"foobar",
"Zm9vYmFy");
57 "Man is distinguished, not only by his reason, but by this "
58 "singular passion from "
59 "other animals, which is a lust of the mind, that by a "
60 "perseverance of delight "
61 "in the continued and indefatigable generation of knowledge, "
63 "vehemence of any carnal pleasure.",
64 "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dC"
66 "IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIG"
68 "dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aG"
70 "dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleG"
72 "ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=");
80BEAST_DEFINE_TESTSUITE(base64, ripple_basics,
ripple);
void run() override
Runs the suite.
void check(std::string const &in, std::string const &out)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string base64_decode(std::string_view data)
std::string base64_encode(std::uint8_t const *data, std::size_t len)