Created
November 15, 2011 09:06
-
-
Save madd0/1366511 to your computer and use it in GitHub Desktop.
Create an MD5 hash digest in C#
This file contains 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 MD5Hash(string toHash) | |
{ | |
string hashed; | |
using (MD5 md5 = MD5.Create()) | |
{ | |
hashed = string.Join(string.Empty, md5.ComputeHash(Encoding.UTF8.GetBytes(toHash)).Select(b => b.ToString("x2"))); | |
} | |
return hashed; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment