Created
October 20, 2011 16:25
-
-
Save bryanhunter/1301593 to your computer and use it in GitHub Desktop.
Get hash code
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 class HashCode | |
{ | |
public static string Of(string content) | |
{ | |
var buffer = Encoding.UTF8.GetBytes(content); | |
var sha1 = new SHA1CryptoServiceProvider(); | |
var hash = BitConverter.ToString(sha1.ComputeHash(buffer)).Replace("-", ""); | |
return hash; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment