|
pure virtual |
This function converts a base64 string of characters back into its orginal form.
This decoding decreases the size of of the input by 1/3 (i.e., converts every group of 4 bytes into 3 bytes). The resulting value can be in text or a binary format. Note, that it is possible to decode in place, that is the parameters "pInb64" and "pDecoded" can point to the SAME buffer.
This function also decodes the modified base64 algorithm as described in the encodeBlockURLSafe() function below.
The base64 definition calls for textual data that is used for input to the encoding algorithm to have its line termination normalized. That is, line termination is to be converted to a carriage return followed by a line feed. Then when the decoding process is performed the normalized line termination is converted to the local machine format. This line terimation conversion is not performed by this function.
pInb64 | [IN] Pointer to a buffer containing base64 ASCII text |
pDecoded | [OUT] The data pointed to by pInb64 decoded out of base64 and into its orginal form |
cBuffer | [IN] Number of bytes in the buffer pointed to by pDecoded. |
pWritten | [OUT] Optional can be NULL, returns the number of bytes written into pDecoded. This parameter cannot be NULL when pDecoded is also NULL. |
Success | P6R::eOk | |
Failure | P6R::eInvalidArg | pInb64 is NULL or cBuffer is zero. If both pDecoded and pWritten are NULL. |
P6R::eFormatError | A non-base64 character found in the pInb64 parameter. | |
P6R::eTooSmall | The buffer pEncoded is too small to contain the generated value. | |
P6R::eNotInitialized | A successful call to initialize has not been done. |