您好,我正在寻找适用于 Windows 8 的 md5 哈希函数(metro 应用程序)
我一直在谷歌(和其他搜索引擎)中寻找这个,但没有任何适用于 windows 8 的内容,其中大多数是关于 win 7(或更早版本)
还是非常感谢 :)
我没有找到 MD5,但我找到了 SHA256,如果您有兴趣,这里有一些示例;)
Function sha512(Key As String)
Dim hash As String
Dim strAlgName As String = "SHA512"
Dim objAlgProv As HashAlgorithmProvider = HashAlgorithmProvider.OpenAlgorithm(strAlgName)
Dim objHash As CryptographicHash = objAlgProv.CreateHash()
Dim buffMsg1 As IBuffer = CryptographicBuffer.ConvertStringToBinary(Key, BinaryStringEncoding.Utf16BE)
objHash.Append(buffMsg1)
Dim buffHash1 As IBuffer = objHash.GetValueAndReset()
Dim strHash1 As String = CryptographicBuffer.EncodeToBase64String(buffHash1)
hash = strHash1
Return hash
End Function