* @brief Base64 encode * * @param in input buffer to encode * @param inLen input buffer length * @param output buffer * @param output buffer length * @return number of character actually written to the output buffer. */
| 275 | * @return number of character actually written to the output buffer. |
| 276 | */ |
| 277 | size_t |
| 278 | cryptoBase64Encode(const char *in, size_t inLen, char *out, size_t outLen) |
| 279 | { |
| 280 | if ((nullptr == in) || (0 == inLen) || (nullptr == out) || 0 == outLen) { |
| 281 | return 0; |
| 282 | } |
| 283 | |
| 284 | if (!ats_base64_encode(in, inLen, out, outLen, &outLen)) { |
| 285 | return 0; |
| 286 | } |
| 287 | |
| 288 | return outLen; |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * @brief Base64 decode |
no test coverage detected