blob: 9a855cdb8d07be2a8d0961e4a280b7bc7ea75ccb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include "commonheaders.h"
string base64encode(const string& buf)
{
return (char*)ptrA(mir_base64_encode((PBYTE)buf.data(), (unsigned)buf.length()));
}
string base64decode(const string& buf)
{
unsigned len;
ptrA plain((char*)mir_base64_decode(buf.data(), &len));
return (plain == NULL) ? string() : string(plain, len);
}
string base64decode(const char *buf)
{
unsigned len;
ptrA plain((char*)mir_base64_decode(buf, &len));
return (plain == NULL) ? string() : string(plain, len);
}
|