|
pure virtual |
This encoding scheme converts the input into a safe set of characters that can be used in URLs.
The base64 alphabet has been modified to replace '+' with '-', and '/' with '_'. In addition, the resulting encoded is not written out in the standard 76 character chunks, but instead as one continous block.
The modified alphabet contains the ASCII characters: { 'A' .. 'Z', 'a' .. 'z', '0' .. '9', '-' , '_', '=' } (the "=" is used for padding). This encoding increases the size of the orginal data by 33% (i.e., converts every group of 3 characters into 4 characters). Note that the resulting Base64 string is 1/3 longer than the original input data.
The base64 definition calls for textual data used for input to have its line termination normalized before the converstion to base64. That is, line termination is to be converted to a carriage return followed by a line feed character. This step is not performed by this function.
pIn | [IN] Text or binary data to be encoded in base64 |
inSize | [IN] The number of bytes containing data in the buffer pointed to by pIn |
pEncoded | [OUT] The data pointed to by pIn converted into base64 encoding. |
cBuffer | [IN] Number of bytes in the buffer pointed to by pEncoded. |
pWritten | [OUT] Optional can be NULL, returns the number of bytes written into pEncoded. This parameter cannot be NULL when pEncoded is also NULL. |
Success | P6R::eOk | |
Failure | P6R::eInvalidArg | pIn is NULL or inSize is zero. If both pDecoded and pWritten are NULL. |
P6R::eTooSmall | The buffer pEncoded is too small to contain the generated value. | |
P6R::eNotInitialized | A successful call to initialize has not been done. |