ESP8266
cencode.h
1 /*
2 cencode.h - c header for a base64 encoding algorithm
3 
4 This is part of the libb64 project, and has been placed in the public domain.
5 For details, see http://sourceforge.net/projects/libb64
6 */
7 
8 #ifndef BASE64_CENCODE_H
9 #define BASE64_CENCODE_H
10 
11 #define base64_encode_expected_len(n) ((((4 * n) / 3) + 3) & ~3)
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 typedef enum {
18  step_A, step_B, step_C
19 } base64_encodestep;
20 
21 typedef struct {
22  base64_encodestep step;
23  char result;
24  int stepcount;
26 
27 void base64_init_encodestate(base64_encodestate* state_in);
28 
29 char base64_encode_value(char value_in);
30 
31 int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in);
32 
33 int base64_encode_blockend(char* code_out, base64_encodestate* state_in);
34 
35 int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out);
36 
37 #ifdef __cplusplus
38 } // extern "C"
39 #endif
40 
41 #endif /* BASE64_CENCODE_H */
int stepcount
Definition: cencode.h:24
base64_encodestep step
Definition: cencode.h:22
char result
Definition: cencode.h:23
Definition: cencode.h:21