Skip to content

Instantly share code, notes, and snippets.

@dkalamari
Created June 16, 2014 08:24
Show Gist options
  • Save dkalamari/8db2d2fb0e77d64a716f to your computer and use it in GitHub Desktop.
Save dkalamari/8db2d2fb0e77d64a716f to your computer and use it in GitHub Desktop.
SHA1 Encrypt
protected static String SHA1Encrypt(String phrase)
{
UTF8Encoding encoder = new UTF8Encoding();
SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();
byte[] hashedDataBytes = sha1.ComputeHash(encoder.GetBytes(phrase));
return ByteArrayToString(hashedDataBytes);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment