8 #include <boost/test/unit_test.hpp>
14 if (s1.size() != s2.size())
return false;
15 for (
size_t i = 0; i < s1.size(); ++i) {
17 if (c1 >=
'A' && c1 <=
'Z') c1 -= (
'A' -
'a');
19 if (c2 >=
'A' && c2 <=
'Z') c2 -= (
'A' -
'a');
20 if (c1 != c2)
return false;
27 static const std::string CASES[] = {
30 "an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1tt5tgs",
31 "an84characterslonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1569pvx",
32 "abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw",
33 "11qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqc8247j",
34 "split1checkupstagehandshakeupstreamerranterredcaperred2y9e3w",
37 for (
const std::string& str : CASES) {
48 static const std::string CASES[] = {
61 for (
const std::string& str : CASES) {
69 for (
size_t i = 0; i < 255; i++) {
70 std::vector<unsigned char> input(32, i);
84 for (
size_t i = 0; i < 255; i++) {
85 std::vector<unsigned char> input(43, i);
BOOST_AUTO_TEST_CASE(bip173_testvectors_valid)
bool CaseInsensitiveEqual(const std::string &s1, const std::string &s2)
BOOST_AUTO_TEST_SUITE_END()
std::pair< std::string, data > Decode(const std::string &str)
Decode a Bech32 string.
std::string Encode(const std::string &hrp, const data &values)
Encode a Bech32 string.
#define BOOST_FIXTURE_TEST_SUITE(a, b)
#define BOOST_CHECK(expr)