BeeCrypt  4.2.1
base64.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2000, 2002 X-Way Rights BV
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  */
19 
25 #ifndef _BASE64_H
26 #define _BASE64_H
27 
28 #include "beecrypt/beecrypt.h"
29 
33 extern const char* b64decode_whitespace;
34 #define B64DECODE_WHITESPACE " \f\n\r\t\v"
35 
39 extern int b64encode_chars_per_line;
40 #define B64ENCODE_CHARS_PER_LINE 72
41 
45 extern const char* b64encode_eolstr;
46 #define B64ENCODE_EOLSTR "\n"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
59 char* b64encode(const void* data, size_t ns);
60 
68 char* b64crc(const unsigned char* data, size_t ns);
69 
78 int b64decode(const char* s, void** datap, size_t* lenp);
79 
83 char* b64enc(const memchunk*);
84 
88 memchunk* b64dec(const char*);
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif