24const static wxChar
cset[] =
wxT(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
29 auto p =
static_cast<const unsigned char*
>(in);
33 for (
int i = 0; i < len / 3; i++)
38 out +=
cset[(temp & 0x00FC0000) >> 18];
39 out +=
cset[(temp & 0x0003F000) >> 12];
40 out +=
cset[(temp & 0x00000FC0) >> 6];
41 out +=
cset[(temp & 0x0000003F)];
48 out +=
cset[(temp & 0x00FC0000) >> 18];
49 out +=
cset[(temp & 0x0003F000) >> 12];
57 out +=
cset[(temp & 0x00FC0000) >> 18];
58 out +=
cset[(temp & 0x0003F000) >> 12];
59 out +=
cset[(temp & 0x00000FC0) >> 6];
69 const auto len = in.length();
70 auto p =
static_cast<unsigned char*
>(out);
79 unsigned long temp = 0;
83 for (
int quantumPosition = 0; quantumPosition < 4; quantumPosition++)
85 unsigned char c = in[i];
88 if (c >= 0x41 && c <= 0x5A)
92 else if (c >= 0x61 && c <= 0x7A)
96 else if (c >= 0x30 && c <= 0x39)
113 *p++ = (temp >> 16) & 0x000000FF;
114 *p++ = (temp >> 8) & 0x000000FF;
115 return p -
static_cast<unsigned char*
>(out);
117 *p++ = (temp >> 10) & 0x000000FF;
118 return p -
static_cast<unsigned char*
>(out);
123 *p++ = (temp >> 16) & 0x000000FF;
124 *p++ = (temp >> 8) & 0x000000FF;
125 *p++ = temp & 0x000000FF;
128 return p -
static_cast<unsigned char*
>(out);
static const wxChar cset[]
STRINGS_API wxString Encode(const void *in, int len)
STRINGS_API int Decode(const wxString &in, void *out)