Fixing retarded SHA2 hashing
This commit is contained in:
parent
da055867c9
commit
2c5f6387a6
1 changed files with 3 additions and 2 deletions
|
|
@ -653,13 +653,14 @@ namespace TShockAPI
|
|||
{
|
||||
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();
|
||||
return enc.GetString(result);
|
||||
final = Encoding.UTF8.GetBytes(enc.GetString(result));
|
||||
return BitConverter.ToString(final);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue