Skip to content

Instantly share code, notes, and snippets.

@bryanhunter
Created October 20, 2011 16:25
Show Gist options
  • Save bryanhunter/1301593 to your computer and use it in GitHub Desktop.
Save bryanhunter/1301593 to your computer and use it in GitHub Desktop.
Get hash code
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