There is only some slow blogging going on recently… So here’s something to fill the Lazyness-Gaps
/// <summary>/// Encrypts the specified Text to SHA1/// </summary>/// <param name="text">The Text to encrypt</param>/// <returns>The SHA1-Encrypted text</returns>public static string EncryptToSHA1(this string text)
{SHA1 sha1 = new SHA1CryptoServiceProvider();
byte[] arrayData = Encoding.ASCII.GetBytes(text);
byte[] arrayResult = sha1.ComputeHash(arrayData);
string result = string.Empty;
string temp = string.Empty;
for (int i = 0; i < arrayResult.Length; i++)
{temp = Convert.ToString(arrayResult[i], 16);
if (temp.Length == 1)
temp = "0" + temp;
result += temp;
}return result;
}