Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IBase64::encodeBlockURLSafe ( const P6CHAR pIn,
P6UINT32  inSize,
P6CHAR pEncoded,
P6UINT32  cBuffer,
P6UINT32 pWritten 
)
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.

Parameters
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.
Returns
SuccessP6R::eOk 
FailureP6R::eInvalidArgpIn is NULL or inSize is zero. If both pDecoded and pWritten are NULL.
P6R::eTooSmallThe buffer pEncoded is too small to contain the generated value.
P6R::eNotInitializedA successful call to initialize has not been done.