Rev 391 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 391 | Rev 393 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include <Parser.h> |
1 | #include <Parser.h> |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | // Base64 Decoder |
3 | // Base64 Decoder |
4 | // see Parser.h for details about sRxData |
4 | // see Parser.h for details about sRxData |
5 | void Parser::decode64(sRxData &rx, unsigned int length) |
5 | void Parser::decode64(sRxData &rx) |
- | 6 | { |
|
6 | { |
7 | int length = rx.str.size(); |
7 | unsigned char a,b,c,d; |
8 | unsigned char a,b,c,d; |
8 | unsigned char ptr = 0; |
9 | unsigned char ptr = 0; |
9 | unsigned char x,y,z; |
10 | unsigned char x,y,z; |
Line 17... | Line 18... | ||
17 | if (rx.Input[ptrIn] == 0) { |
18 | if (rx.Input[ptrIn] == 0) { |
18 | throw "Nothing received"; |
19 | throw "Nothing received"; |
19 | } |
20 | } |
Line 20... | Line 21... | ||
20 | 21 | ||
21 | while(len != 0) { |
22 | while(len != 0) { |
22 | a = RX.input[ptrIn++] - '='; |
23 | a = rx.input[ptrIn++] - '='; |
23 | b = RX.input[ptrIn++] - '='; |
24 | b = rx.input[ptrIn++] - '='; |
24 | c = RX.input[ptrIn++] - '='; |
25 | c = rx.input[ptrIn++] - '='; |
Line 25... | Line 26... | ||
25 | d = RX.input[ptrIn++] - '='; |
26 | d = rx.input[ptrIn++] - '='; |
Line 26... | Line 27... | ||
26 | 27 | ||
27 | if(ptrIn > max - 2) break; |
28 | if(ptrIn > max - 2) break; |