Base64 encoding and decoding, headers.
More...
#include "beecrypt/beecrypt.h"
Go to the source code of this file.
Detailed Description
Base64 encoding and decoding, headers.
- Author:
- Bob Deblier <bob.deblier@telenet.be>
Define Documentation
#define B64DECODE_WHITESPACE " \f\n\r\t\v" |
#define B64ENCODE_CHARS_PER_LINE 72 |
#define B64ENCODE_EOLSTR "\n" |
Function Documentation
char* b64crc |
( |
const unsigned char * |
data, |
|
|
size_t |
ns |
|
) |
| |
Encode crc of binary input data into 5 bytes of base64 output.
- Parameters:
-
data | binary data |
ns | no. bytes of binary data |
- Returns:
- (malloc'd) base64 string
int b64decode |
( |
const char * |
s, |
|
|
void ** |
datap, |
|
|
size_t * |
lenp |
|
) |
| |
Decode chunks of 4 bytes of base64 input into 3 bytes of binary output.
- Parameters:
-
- Return values:
-
datap | address of (malloc'd) binary data |
lenp | address of no. bytes of binary data |
- Returns:
- 0 on success, 1: s == NULL, 2: bad length, 3: bad char
char* b64encode |
( |
const void * |
data, |
|
|
size_t |
ns |
|
) |
| |
Encode chunks of 3 bytes of binary input into 4 bytes of base64 output.
- Parameters:
-
data | binary data |
ns | no. bytes of data (0 uses strlen(data)) |
- Returns:
- (malloc'd) base64 string
Variable Documentation
\ Decode white space character set (default).
\ Encode 72 characters per line (default).
\ Encode end-of-line string (default).