Skip to content

Instantly share code, notes, and snippets.

View danielts86's full-sized avatar

Daniel Tshuva danielts86

View GitHub Profile
byte[] HashSHA1(string phrase)
{
if (phrase == null)
return null;
var encoder = new UTF8Encoding();
var sha1Hasher = new SHA1CryptoServiceProvider();
var hashedDataBytes = sha1Hasher.ComputeHash(encoder.GetBytes(phrase));
return hashedDataBytes;
}