Out with the new! In with the old!

This commit is contained in:
Lucas Nicodemus 2011-06-30 20:02:47 -06:00
parent 2c5f6387a6
commit c5c0a7e506

View file

@ -651,16 +651,10 @@ namespace TShockAPI
/// <returns>string sha256</returns>
public static string HashPassword(string password)
{
byte[] data = StrToByteArray(password);
byte[] result;
byte[] final;
using (SHA256 shaM = new SHA256Managed())
{
result = shaM.ComputeHash(data);
}
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
final = Encoding.UTF8.GetBytes(enc.GetString(result));
return BitConverter.ToString(final);
Encoding enc = System.Text.Encoding.UTF8;
byte[] buffer = enc.GetBytes(password);
SHA1CryptoServiceProvider cryptoTransformSHA1 = new SHA1CryptoServiceProvider();
return BitConverter.ToString(cryptoTransformSHA1.ComputeHash(buffer)).Replace("-", "");
}
}
}