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