This commit is contained in:
andrei-mihnea-cerbu
2024-04-08 00:03:24 +03:00
parent 2ccec617a5
commit b48d5ee19e
168 changed files with 2877 additions and 1146 deletions
@@ -0,0 +1,19 @@
using System.Security.Cryptography;
using System.Text;
using Application.Services.HashingAlgorithms;
namespace Infrastructure.Services.HashingAlgorithms;
public class HashingAlgorithms : IHashingAlgorithms
{
public string? SHA256Algorithm(string? password)
{
if (password == null) return null;
using (var sha256 = SHA256.Create())
{
var bytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(password));
return Convert.ToBase64String(bytes);
}
}
}