Options to use lowercase base32 encoding without padding

This commit is contained in:
Mikhail Titov
2015-06-16 22:39:36 -05:00
parent 1d2727ad25
commit 007a580207
3 changed files with 35 additions and 6 deletions

View File

@@ -118,6 +118,11 @@ TORRENT_TEST(string)
TEST_CHECK(base32encode("fooba") == "MZXW6YTB");
TEST_CHECK(base32encode("foobar") == "MZXW6YTBOI======");
// base32 for i2p
TEST_CHECK(base32encode("fo", string::no_padding) == "MZXQ");
TEST_CHECK(base32encode("foob", string::i2p) == "mzxw6yq");
TEST_CHECK(base32encode("foobar", string::lowercase) == "mzxw6ytboi======");
TEST_CHECK(base32decode("") == "");
TEST_CHECK(base32decode("MY======") == "f");
TEST_CHECK(base32decode("MZXQ====") == "fo");