]> mj.ucw.cz Git - moe.git/blob - lib/base224.h
Added libucw from Sherlock v3.12.2.
[moe.git] / lib / base224.h
1 /*
2  *      UCW Library -- Base 224 Encoding & Decoding
3  *
4  *      (c) 2002 Martin Mares <mj@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 base224_encode(byte *dest, const byte *src, uns len);
11 uns base224_decode(byte *dest, const byte *src, uns len);
12
13 /*
14  * Warning: when encoding, at least 4 bytes of extra space are needed.
15  * Better use this macro to calculate buffer size.
16  */
17 #define BASE224_ENC_LENGTH(x) (((x)*8+38)/39*5)
18
19 /*
20  * When called for BASE224_IN_CHUNK-byte chunks, the result will be
21  * always BASE224_OUT_CHUNK bytes long. If a longer block is split
22  * to such chunks, the result will be identical.
23  */
24 #define BASE224_IN_CHUNK 39
25 #define BASE224_OUT_CHUNK 40