From f82b7bb9d7d1ef43d11c6450f143f3796707a745 Mon Sep 17 00:00:00 2001 From: Matheo THIERRY Date: Tue, 30 May 2023 17:25:50 +0200 Subject: [PATCH] erreur fix --- notus/Notus_Persistence/Stub.cs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/notus/Notus_Persistence/Stub.cs b/notus/Notus_Persistence/Stub.cs index 71e32ff..fb8ed2c 100644 --- a/notus/Notus_Persistence/Stub.cs +++ b/notus/Notus_Persistence/Stub.cs @@ -7,21 +7,6 @@ using System.Text; using System.Security.Cryptography; using System.Threading.Tasks; -static string GetSHA256Hash(string input) -{ - using (SHA256 sha256Hash = SHA256.Create()) - { - byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input)); - - StringBuilder builder = new StringBuilder(); - for (int i = 0; i < bytes.Length; i++) - { - builder.Append(bytes[i].ToString("x2")); - } - - return builder.ToString(); - } -} namespace Notus_Persistance { @@ -78,7 +63,7 @@ namespace Notus_Persistance foreach (User user in database.GetUserList()) { - user.SetPassword(GetSHA256Hash(user.GetPassword())); + user.SetPassword(user.GetPassword().GetHashCode().ToString()); } return database;