Go to the documentation of this file.
1 /**********
2 This library is free software; you can redistribute it and/or modify it under
3 the terms of the GNU Lesser General Public License as published by the
4 Free Software Foundation; either version 3 of the License, or (at your
5 option) any later version. (See <>.)
7 This library is distributed in the hope that it will be useful, but WITHOUT
8 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10 more details.
12 You should have received a copy of the GNU Lesser General Public License
13 along with this library; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 **********/
16 // "liveMedia"
17 // Copyright (c) 1996-2022 Live Networks, Inc. All rights reserved.
18 // Base64 encoding and decoding
19 // C++ header
21 #ifndef _BASE64_HH
22 #define _BASE64_HH
24 #ifndef _BOOLEAN_HH
25 #include "Boolean.hh"
26 #endif
28 unsigned char* base64Decode(char const* in, unsigned& resultSize,
29  Boolean trimTrailingZeros = True);
30  // returns a newly allocated array - of size "resultSize" - that
31  // the caller is responsible for delete[]ing.
33 unsigned char* base64Decode(char const* in, unsigned inSize,
34  unsigned& resultSize,
35  Boolean trimTrailingZeros = True);
36  // As above, but includes the size of the input string (i.e., the number of bytes to decode) as a parameter.
37  // This saves an extra call to "strlen()" if we already know the length of the input string.
39 char* base64Encode(char const* orig, unsigned origLength);
40  // returns a 0-terminated string that
41  // the caller is responsible for delete[]ing.
43 #endif
char * base64Encode(char const *orig, unsigned origLength)
unsigned char * base64Decode(char const *in, unsigned &resultSize, Boolean trimTrailingZeros=True)
const Boolean True
Definition: Boolean.hh:31
unsigned char Boolean
Definition: Boolean.hh:25