Created
February 13, 2014 10:05
-
-
Save tugberkugurlu/8972652 to your computer and use it in GitHub Desktop.
CreateMD5Hash
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
protected virtual string CreateMD5Hash(string input) | |
{ | |
MD5 md5 = System.Security.Cryptography.MD5.Create(); | |
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input); | |
byte[] hashBytes = md5.ComputeHash(inputBytes); | |
StringBuilder sb = new StringBuilder(); | |
for (int i = 0; i < hashBytes.Length; i++) | |
{ | |
sb.Append(hashBytes[i].ToString("X2")); | |
} | |
return sb.ToString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment