在UWP的库中,发现找不到MD5CryptoServiceProvider这个类了

改用方法如下


string input = "";
var alg = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Md5);
IBuffer buff = CryptographicBuffer.ConvertStringToBinary(input, BinaryStringEncoding.Utf8);
var hashed = alg.HashData(buff);
var result = CryptographicBuffer.EncodeToHexString(hashed);


标签: