Base64 Utility APIs

Header File

Source: include/crypto/base64.h

#include <crypto/base64.h>

Functions

int base64_encode(const unsigned char *input, int inlen, unsigned char *output, int outsize)

BASE64 Encode a buffer

Parameters:
  • input – [in] Input buffer

  • inlen – [in] Size of data in input buffer

  • output – [out] Output buffer to store encoded data

  • outsize – [in] size of output buffer

Returns:

On success, this function returns size of encoded data, and negative value on error

int base64_decode(const unsigned char *input, int inlen, unsigned char *output, int outsize)

BASE64 decode

Parameters:
  • input – [in] Input encoded data

  • inlen – [in] Length of input data

  • output – [out] Output buffer to store decoded data

  • outsize – [in] Size of output buffer

Returns:

On success, this function returns size of encoded data, and negative value on error