65{
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
66'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
67'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
68'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
69'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'+',
'/' };
77 sal_Int32 nBinaer = (src[ 0] << 16) +
84 nIndex = (nBinaer & 0x3F000) >> 12;
87 nIndex = (nBinaer & 0xFC0) >> 6;
99 std::unique_ptr<char[]> buffer;
101 sal_Int32 cycles = len/3;
102 sal_Int32 remain = len%3;
107 nNeeded = (cycles+1)*4;
108 buffer.reset(
new char[nNeeded+1]);
110 memset(buffer.get(), 0, nNeeded+1);
112 for( sal_Int32
i=0;
i<cycles;
i++ )
118 last[0] = buf[len-1];
122 else if( remain == 2 )
124 last[0] = buf[len-2];
125 last[1] = buf[len-1];
130 OUString str = OUString::createFromAscii(buffer.get());
static OUString Encode(sal_uInt8 const *buf, sal_Int32 len)
@descr Encode binary buffer to base64 encoding.
constexpr OUStringLiteral last
static void Encode_(const sal_uInt8 *src, char *dest)
@descr Encode 3 byte to 4 byte.
const char aBase64EncodeTable[]