Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IBinhex::bin2hex ( const P6UCHAR pIn,
P6UINT32  inSize,
P6CHAR pHex,
P6UINT32  cBuffer,
P6UINT32 pWritten 
)
pure virtual

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