base64 header

The documentation of QEMU’s qemu/base64.h header.

uint8_t * qbase64_decode(const char * input, size_t in_len, size_t * out_len, Error ** errp)

Parameters

const char * input
the (possibly) base64 encoded text
size_t in_len
length of input or -1 if NUL terminated
size_t * out_len
filled with length of decoded data
Error ** errp
pointer to a NULL-initialized error object

Description

Attempt to decode the (possibly) base64 encoded text provided in input. If the input text may contain embedded NUL characters, or may not be NUL terminated, then in_len must be set to the known size of the input buffer.

Note that embedded NULs, or lack of a NUL terminator are considered invalid base64 data and errors will be reported to this effect.

If decoding is successful, the decoded data will be returned and out_len set to indicate the number of bytes in the decoded data. The caller must use g_free() to free the returned data when it is no longer required.

Return

the decoded data or NULL