I\'m creating a MetroStyle app and I want to generate a MD5 code for my string. So far I\'ve used this:
public static string ComputeMD5(string str)
{
OK. I've found how to do this. Here's the final code:
public static string ComputeMD5(string str)
{
var alg = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Md5);
IBuffer buff = CryptographicBuffer.ConvertStringToBinary(str, BinaryStringEncoding.Utf8);
var hashed = alg.HashData(buff);
var res = CryptographicBuffer.EncodeToHexString(hashed);
return res;
}