-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase64.h
36 lines (32 loc) · 1.03 KB
/
base64.h
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
/*******************************************************************
* File: base64
* Purpose: Base64 manipulation routines - originally written for the
* DataURLFetcher module
* Author: Justin Fletcher
* Date: 24 Dec 2000
******************************************************************/
#ifndef BASE64_H
#define BASE64_H
/* Decode a section of base64 -
=>
in-> pointer to input buffer
inlen-> length of input buffer
out-> output buffer
outlen = length of output buffer
<=
number of characters written into output buffer, or -1 if not enough
space
*/
int base64_decode (const char **inp, int *inlen, char *out, int outlen);
/* Encode a data block in base64 -
=>
in-> pointer to input buffer
inlen-> length of input buffer
out-> output buffer
outlen = length of output buffer
<=
number of characters written into output buffer, or -1 if not enough
space
*/
int base64_encode (const char *in, int inlen, char *out, int outlen);
#endif