feat(base58): unfixed bug with double \0 and incorrect real str_size
This commit is contained in:
@ -18,14 +18,14 @@ TEST(base64, isValid)
|
||||
for (auto it : tests)
|
||||
EXPECT_EQ(it.first, isValid(it.second));
|
||||
}
|
||||
std::vector<std::pair<std::string, std::string>> tests = {
|
||||
{"", ""},
|
||||
{"BKUEpQ==", "04a504a5"},
|
||||
{"BKUEpQA=", "04a504a500"},
|
||||
{"BKUEpQAA", "04a504a50000"},
|
||||
};
|
||||
TEST(base64, encode)
|
||||
{
|
||||
std::vector<std::pair<std::string, std::string>> tests = {
|
||||
{"", ""},
|
||||
{"BKUEpQ==", "04a504a5"},
|
||||
{"BKUEpQA=", "04a504a500"},
|
||||
{"BKUEpQAA", "04a504a50000"},
|
||||
};
|
||||
for (auto it : tests)
|
||||
EXPECT_EQ(it.first, encode(hex::decode(it.second)));
|
||||
}
|
||||
@ -36,12 +36,6 @@ TEST(base64, encode_1e7)
|
||||
}
|
||||
TEST(base64, decode)
|
||||
{
|
||||
std::vector<std::pair<std::string, std::string>> tests = {
|
||||
{"", ""},
|
||||
{"BKUEpQ==", "04a504a5"},
|
||||
{"BKUEpQA=", "04a504a500"},
|
||||
{"BKUEpQAA", "04a504a50000"},
|
||||
};
|
||||
for (auto it : tests)
|
||||
EXPECT_EQ(hex::encode(decode(it.first)), it.second);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user