comparison base64.h @ 958:f789d66969a4 libavutil

base64: improve documentation
author mru
date Wed, 30 Jun 2010 20:09:32 +0000
parents e34e8d654ded
children
comparison
equal deleted inserted replaced
957:e34e8d654ded 958:f789d66969a4
22 #define AVUTIL_BASE64_H 22 #define AVUTIL_BASE64_H
23 23
24 #include <stdint.h> 24 #include <stdint.h>
25 25
26 /** 26 /**
27 * Decode the base64-encoded string in in and put the decoded 27 * Decode a base64-encoded string.
28 * data in out.
29 * 28 *
30 * @param out_size size in bytes of the out buffer, it should be at 29 * @param out buffer for decoded data
31 * least 3/4 of the length of in 30 * @param in null-terminated input string
32 * @return the number of bytes written, or a negative value in case of 31 * @param out_size size in bytes of the out buffer, must be at
33 * error 32 * least 3/4 of the length of in
33 * @return number of bytes written, or a negative value in case of
34 * invalid input
34 */ 35 */
35 int av_base64_decode(uint8_t *out, const char *in, int out_size); 36 int av_base64_decode(uint8_t *out, const char *in, int out_size);
36 37
37 /** 38 /**
38 * Encode in base64 the data in in and put the resulting string 39 * Encode data to base64 and null-terminate.
39 * in out.
40 * 40 *
41 * @param out_size size in bytes of the out string, it should be at 41 * @param out buffer for encoded data
42 * least ((in_size + 2) / 3) * 4 + 1 42 * @param out_size size in bytes of the output buffer, must be at
43 * @param in_size size in bytes of the in buffer 43 * least AV_BASE64_SIZE(in_size)
44 * @return the string containing the encoded data, or NULL in case of 44 * @param in_size size in bytes of the 'in' buffer
45 * error 45 * @return 'out' or NULL in case of error
46 */ 46 */
47 char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); 47 char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
48 48
49 /** 49 /**
50 * Calculate the output size needed to base64-encode x bytes. 50 * Calculate the output size needed to base64-encode x bytes.