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