This function converts binary data into a hexadecimal character string format.
The hexadecimal encoding scheme is typically used to convert a binary blob into a character string for some type of storage or network transfer. The output generated by this function line terminates the result copied into pHex.
The parameter pHex can be set to NULL. In this case, this function returns the buffer size required to perform the encode operation.
- Parameters
-
pIn | [ in ] Text or binary data to be encoded in hexadecimal |
inSize | [ in ] The number of bytes containing data in the buffer pointed to by pIn |
pHex | [ out ] The data pointed to by pIn converted into hexadecimal encoding. |
cBuffer | [ in ] Number of bytes in the buffer pointed to by pHex. |
pWritten | [ out ] Optional can be NULL, returns the number of bytes written into pHex. This parameter cannot be NULL when pHex is also NULL. |
- Returns
Success | P6R::eOk | |
Failure | P6R::eInvalidArg | pIn is NULL, or inSize is zero. If pHex and pWritten are NULL. |
P6R::eTooSmall | The buffer pHex is too small to contain the generated value. |
P6R::eNotInitialized | A successful call to initialize has not been done. |