|
a/src/utils/base64.cpp |
|
b/src/utils/base64.cpp |
|
... |
|
... |
38 |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
38 |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
39 |
static const char Pad64 = '=';
|
39 |
static const char Pad64 = '=';
|
40 |
bool base64_decode(const string& in, string& out)
|
40 |
bool base64_decode(const string& in, string& out)
|
41 |
{
|
41 |
{
|
42 |
int io = 0, state = 0, ch = 0;
|
42 |
int io = 0, state = 0, ch = 0;
|
43 |
char *pos;
|
43 |
const char *pos;
|
44 |
unsigned int ii = 0;
|
44 |
unsigned int ii = 0;
|
45 |
out.erase();
|
45 |
out.erase();
|
46 |
out.reserve(in.length());
|
46 |
out.reserve(in.length());
|
47 |
|
47 |
|
48 |
for (ii = 0; ii < in.length(); ii++) {
|
48 |
for (ii = 0; ii < in.length(); ii++) {
|