Created
November 28, 2016 07:43
-
-
Save lindexi/0ecf1d8de7a222cda5f058e74de335c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string Md5(string str) | |
{ | |
HashAlgorithmProvider hashAlgorithm = | |
HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Md5); | |
CryptographicHash cryptographic = hashAlgorithm.CreateHash(); | |
IBuffer buffer = CryptographicBuffer.ConvertStringToBinary(str, BinaryStringEncoding.Utf8); | |
cryptographic.Append(buffer); | |
return CryptographicBuffer.EncodeToHexString(cryptographic.GetValueAndReset()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment