Fixed broken auth system.

This commit is contained in:
Lucas Nicodemus 2011-07-24 17:36:57 -06:00
parent 7a829d347b
commit 71d05f51ec

View file

@ -502,8 +502,8 @@ namespace TShockAPI
/// <returns>string sha256</returns>
public static string HashPassword(string password)
{
if (string.IsNullOrEmpty(password))
throw new NullReferenceException("Password can not be null/empty");
if (string.IsNullOrEmpty(password) || password == "non-existant password")
return "non-existant password";
var bytes = HashAlgo.ComputeHash(Encoding.ASCII.GetBytes(password));
return bytes.Aggregate("", (s, b) => s + b.ToString("X2"));
}