Go to the source code of this file.
Macros | |
#define | LE_BASE64_ENCODED_SIZE(x) (4 * ((x + 2) / 3)) |
Functions | |
le_result_t | le_base64_Encode (const uint8_t *dataPtr, size_t dataLength, char *result, size_t *resultSizePtr) |
le_result_t | le_base64_Decode (const char *srcPtr, size_t srcLen, uint8_t *dstPtr, size_t *dstLenPtr) |
Detailed Description
Legato Base64 encoding/decoding API include file.
Copyright (C) Sierra Wireless Inc.
Macro Definition Documentation
◆ LE_BASE64_ENCODED_SIZE
#define LE_BASE64_ENCODED_SIZE | ( | x | ) | (4 * ((x + 2) / 3)) |
Calculate the encoded string length (including padding, not including terminating zero) for a given binary data size.
Function Documentation
◆ le_base64_Decode()
le_result_t le_base64_Decode | ( | const char * | srcPtr, |
size_t | srcLen, | ||
uint8_t * | dstPtr, | ||
size_t * | dstLenPtr | ||
) |
Decode base64-encoded data.
- Returns
- LE_OK if succeeds
- LE_BAD_PARAMETER if NULL pointer provided
- LE_FORMAT_ERROR if data contains invalid (non-base64) characters
- LE_OVERFLOW if provided buffer is not large enough
- Parameters
-
[in] srcPtr Encoded string [in] srcLen Encoded string length [out] dstPtr Binary data buffer [in,out] dstLenPtr Binary data buffer size / decoded data size
◆ le_base64_Encode()
le_result_t le_base64_Encode | ( | const uint8_t * | dataPtr, |
size_t | dataLength, | ||
char * | result, | ||
size_t * | resultSizePtr | ||
) |
Perform base64 data encoding.
- Returns
- LE_OK if succeeds
- LE_BAD_PARAMETER if NULL pointer provided
- LE_OVERFLOW if provided buffer is not large enough
- Parameters
-
[in] dataPtr Data to be encoded [in] dataLength Data length [out] result Base64-encoded string buffer [in,out] resultSizePtr Length of the base64-encoded string buffer