I got bored the other day and I don't visit this forum that much and I'm gonna try to change that, so to start that off, I'm going to share my class with you guys.
If you guys encounter any problems, just apprise me about it and I will try to implement some kind of fix to any problems. Enjoy.
Code:
public class Hash
{
public string SHA1(string input)
{
byte[] hash;
using (var sha1 = new System.Security.Cryptography.SHA1CryptoServiceProvider())
{
hash = sha1.ComputeHash(Encoding.Unicode.GetBytes(input));
}
var sb = new StringBuilder();
foreach (byte b in hash) sb.AppendFormat("{0:x2}", b);
return sb.ToString();
}
public string MD5(string input)
{
MD5 md5 = new MD5CryptoServiceProvider();
string pass = Console.ReadLine();
byte[] checkSum = md5.ComputeHash(Encoding.Unicode.GetBytes(input));
string result = BitConverter.ToString(checkSum).Replace("-", String.Empty);
return result.ToLower();
}
}
If you guys encounter any problems, just apprise me about it and I will try to implement some kind of fix to any problems. Enjoy.