mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-28 16:08:38 +00:00
Make HashHelper.Sha256Hash lowercase by default, fix ResetPasswordCommand
This commit is contained in:
parent
3e4f1de5fe
commit
cc2be73bb0
2 changed files with 3 additions and 1 deletions
|
@ -39,6 +39,8 @@ namespace LBPUnion.ProjectLighthouse.CommandLine
|
|||
|
||||
user.Password = HashHelper.BCryptHash(password);
|
||||
|
||||
await this.database.SaveChangesAsync();
|
||||
|
||||
Console.WriteLine($"The password for user {user.Username} (id: {user.UserId}) has been reset.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace LBPUnion.ProjectLighthouse.Helpers
|
|||
|
||||
public static string Sha256Hash(string str) => Sha256Hash(Encoding.UTF8.GetBytes(str));
|
||||
|
||||
public static string Sha256Hash(byte[] bytes) => BitConverter.ToString(sha256.ComputeHash(bytes)).Replace("-", "");
|
||||
public static string Sha256Hash(byte[] bytes) => BitConverter.ToString(sha256.ComputeHash(bytes)).Replace("-", "").ToLower();
|
||||
|
||||
public static string Sha1Hash(string str) => Sha1Hash(Encoding.UTF8.GetBytes(str));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue