]> git.ozlabs.org Git - ccan/blob - ccan/base64/_info
base64: implements rfc4648, the base64 encoding
[ccan] / ccan / base64 / _info
1 #include "config.h"
2
3 /**
4  * base64 - base64 encoding and decoding (rfc4648).
5  *
6  * base64 encoding is used to encode data in a 7-bit clean manner.
7  *  Commonly used for escaping data before encapsulation or transfer
8  *
9  * Example:
10  *      #include <stdio.h>
11  *      #include <string.h>
12  *      #include <ccan/base64/base64.h>
13  *
14  *      int main(int argc, char *argv[])
15  *      {
16  *              char *base64_encoded_string;
17  *              int i;
18  *
19  *              // print the base64-encoded form of the program arguments
20  *              for(i=1;i<argc;i++) {
21  *                      size_t unencoded_length = strlen(argv[i]);
22  *                      size_t encoded_length = base64_encoded_length(unencoded_length);
23  *                      base64_encoded_string = malloc(encoded_length);
24  *                      base64_encode(base64_encoded_string, encoded_length,
25  *                               argv[i], unencoded_length);
26  *                      printf("%s\n", base64_encoded_string);
27  *                      free(base64_encoded_string);
28  *              }
29  *
30  *              return 0;
31  *      }
32  *
33  * License: BSD-MIT
34  */
35 int main(int argc, char *argv[])
36 {
37         if (argc != 2)
38                 return 1;
39
40         return 1;
41 }