mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
Base32 decode lowercased characters as well
This commit is contained in:
parent
432675e512
commit
d0b6a88f9c
2 changed files with 5 additions and 0 deletions
|
@ -64,6 +64,8 @@ std::string decode(InputIterator first, InputIterator last)
|
|||
unsigned char value;
|
||||
if('A' <= ch && ch <= 'Z') {
|
||||
value = ch-'A';
|
||||
} else if('a' <= ch && ch <= 'z') {
|
||||
value = ch-'a';
|
||||
} else if('2' <= ch && ch <= '7') {
|
||||
value = ch-'2'+26;
|
||||
} else if(ch == '=') {
|
||||
|
|
|
@ -48,6 +48,9 @@ void Base32Test::testDecode()
|
|||
s = "GEZDGNBV";
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("12345"),
|
||||
base32::decode(s.begin(), s.end()));
|
||||
s = "gezdgnbv";
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("12345"),
|
||||
base32::decode(s.begin(), s.end()));
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue