Skip to content

Instantly share code, notes, and snippets.

@FernandoVezzali
Created May 1, 2013 08:41
Show Gist options
  • Save FernandoVezzali/5494352 to your computer and use it in GitHub Desktop.
Save FernandoVezzali/5494352 to your computer and use it in GitHub Desktop.
public static String Sha1(String plainText)
{
Byte[] text, hashBytes;
using (SHA1Managed sha1 = new SHA1Managed())
{
text = Encoding.Unicode.GetBytes(plainText);
hashBytes = sha1.ComputeHash(text);
}
return Convert.ToBase64String(hashBytes);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment