CryptographicBuffer.EncodeToHexString(IBuffer) CryptographicBuffer.EncodeToHexString(IBuffer) CryptographicBuffer.EncodeToHexString(IBuffer) CryptographicBuffer.EncodeToHexString(IBuffer) CryptographicBuffer.EncodeToHexString(IBuffer) Method

Definition

Encodes a buffer to a hexadecimal string.

public : static Platform::String EncodeToHexString(IBuffer buffer)
static winrt::hstring EncodeToHexString(IBuffer buffer) const;
public static string EncodeToHexString(IBuffer buffer)
Public Shared Function EncodeToHexString(buffer As IBuffer) As string
var string = Windows.Security.Cryptography.CryptographicBuffer.encodeToHexString(buffer);

Parameters

buffer
IBuffer IBuffer IBuffer

Input buffer.

Returns

string string string

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);
}