Encoding and decoding data (HTML)

To send data between computers across a network the data must be serialized. That is, the data must be disassembled into a bit string and transmitted serially. The computer that receives the serialized stream reassembles it into its original data format. You can use the following static methods in the Windows.Security.Cryptography namespace to encode and decode data.

Method Description
DecodeFromBase64String

Decodes a string from base64. Base64 is an encoding scheme used to transmit binary data. The data to be encoded is examined three bytes at a time. Every six bits in the 24-bit buffer is used as an index into a text string. The text strings used vary depending on the type of data being encoded.

DecodeFromHexString

Decodes from a hexadecimal string. Each 4-bit nibble of the string is represented as a number between 0 and 9 or a letter between A and F (or a and f).

EncodeToBase64String

Encodes data to a Base64 string.

EncodeToHexString

Encodes data to a hexadecimal string.

 

For examples, see the following topics:

Encrypting data and working with Certificates