hl7parse
Functions
base64.h File Reference

hl7 base64 decoder and encoder. More...

#include <inttypes.h>
Include dependency graph for base64.h:

Go to the source code of this file.

Functions

int base64decode (char *in, size_t inLen, unsigned char *out, size_t *outLen)
 decode base64 a buffer More...
 
int hl7_64decode (char *in, size_t inLen, unsigned char *out, size_t *outLen)
 decode base64 a buffer More...
 
int hl7_64decode_fd (char *in, size_t inLen, FILE *out_fd)
 decode base64 buffer to a file More...
 
int base64encode (const void *data_buf, size_t dataLength, char *result, size_t resultSize)
 encode base64 More...
 

Detailed Description

hl7 base64 decoder and encoder.

These methods are able to decode hl7 sequence .br\ on a base64 stream

Function Documentation

◆ base64decode()

int base64decode ( char *  in,
size_t  inLen,
unsigned char *  out,
size_t *  outLen 
)

decode base64 a buffer

Parameters
inchar array to decode
inLenlength of input
outarray holding output
outLenlength of output
Returns
0 on success, 1 invalid input

◆ base64encode()

int base64encode ( const void *  data_buf,
size_t  dataLength,
char *  result,
size_t  resultSize 
)

encode base64

Parameters
data_bufchar array to encode
dataLengthlength of input
resultarray holding output
resultSizelength of output
Returns
0 on success, invalid input

◆ hl7_64decode()

int hl7_64decode ( char *  in,
size_t  inLen,
unsigned char *  out,
size_t *  outLen 
)

decode base64 a buffer

skip \.br\ sequences typically found in hl7 base64 encoded multiline strings.

Parameters
inchar array to decode
inLenlength of input
outarray holding output
outLenlength of output
Returns
0 on success, 1 invalid input, 2 invalid escape sequence

◆ hl7_64decode_fd()

int hl7_64decode_fd ( char *  in,
size_t  inLen,
FILE *  out_fd 
)

decode base64 buffer to a file

skip \.br\ sequences typically found in hl7 base64 encoded multiline strings.

Parameters
inchar array to decode
inLenlength of input
out_fdfile handle to write result to
Returns
0 on success, 1 invalid input, 2 invalid escape sequence