CryptographicBuffer.EncodeToHexString(IBuffer) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Encodes a buffer to a hexadecimal string.
public:
static Platform::String ^ EncodeToHexString(IBuffer ^ buffer);
static winrt::hstring EncodeToHexString(IBuffer const& buffer);
public static string EncodeToHexString(IBuffer buffer);
function encodeToHexString(buffer)
Public Shared Function EncodeToHexString (buffer As IBuffer) As String
Parameters
- buffer
- IBuffer
Input buffer.
Returns
Hexadecimal encoded output string.
Examples
public void EncodeDecodeHex()
{
// Define a hexadecimal string.
String strHex = "30310AFF";
// Decode a hexadecimal string to binary.
IBuffer buffer = CryptographicBuffer.DecodeFromHexString(strHex);
// Encode the buffer back into a hexadecimal string.
String strHexNew = CryptographicBuffer.EncodeToHexString(buffer);
}