2
* WengoPhone, a voice over Internet phone
3
* Copyright (C) 2004-2006 Wengo
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
#include <util/owutildll.h>
24
#include <util/NonCopyable.h>
29
* Base64 encoding and decoding.
31
* Base64 is commonly used in everyday SMTP mail messages, for example.
32
* Note that encoding is not compression: it simply reduces a byte stream
33
* to printable ASCII characters, actually increasing the size of the data
34
* as a side effect (e.g. where the original data is a 100-byte stream
35
* containing values 0-255, the base64 encoding will be a 136-byte stream
36
* containing values 0-63, the effect being that these can be ASCII-encoded).
38
* @see http://www.ietf.org/rfc/rfc3548.txt
39
* @author Tanguy Krotoff
41
class Base64 : NonCopyable {
45
* Encodes using base64.
47
* @param stringToEncode string to encode
48
* @return encoded string
50
OWUTIL_API static std::string encode(const std::string & stringToEncode);
53
* Decodes using base64.
55
* @param encodedString encoded string
56
* @return decoded string
58
OWUTIL_API static std::string decode(const std::string & encodedString);