1 /* base64 encoder/decoder based on public domain implementation
5 * \file rpmio/rpmbase64.h
7 * Base64 encoding and decoding API
10 #include <sys/types.h>
16 /* returns malloced base64 encoded string
17 * lines are split with \n characters to be nearest lower multiple of linelen
18 * if linelen/4 == 0 lines are not split
19 * if linelen < 0 default line length (64) is used
20 * the returned string is empty when len == 0
21 * returns NULL on failures
23 char *rpmBase64Encode(const void *data, size_t len, int linelen);
25 /* decodes from zero terminated base64 encoded string to a newly malloced buffer
26 * ignores whitespace characters in the input string
31 * 3 - invalid characters on input
34 int rpmBase64Decode(const char *in, void **out, size_t *outlen);
36 /* counts CRC24 and base64 encodes it in a malloced string
37 * returns NULL on failures
39 char *rpmBase64CRC(const unsigned char *data, size_t len);