]> mj.ucw.cz Git - libucw.git/blob - lib/base64.h
Merge with git+ssh://git.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / lib / base64.h
1 /*
2  *      UCW Library -- Base 64 Encoding & Decoding
3  *
4  *      (c) 2002, Robert Spalek <robert@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 uns base64_encode(byte *dest, byte *src, uns len);
11 uns base64_decode(byte *dest, byte *src, uns len);
12
13 /*
14  * Use this macro to calculate buffer size.
15  */
16 #define BASE64_ENC_LENGTH(x) (((x)+2)/3 *4)
17
18 /*
19  * When called for BASE64_IN_CHUNK-byte chunks, the result will be
20  * always BASE64_OUT_CHUNK bytes long. If a longer block is split
21  * to such chunks, the result will be identical.
22  */
23 #define BASE64_IN_CHUNK 3
24 #define BASE64_OUT_CHUNK 4
25