CodeLiturgy.Dashboard/CodeLiturgy.Views/Application/Users/Auth/Crypto/IHasher.cs

34 lines
1001 B
C#
Raw Normal View History

2022-11-18 03:15:53 +03:00
using CodeLiturgy.Data.Application.Users;
using CodeLiturgy.Data.Auth.Context.Users;
2022-09-26 04:40:18 +03:00
using Microsoft.AspNetCore.Identity;
namespace BlueWest.Cryptography;
/// <summary>
/// IHasher contract
/// </summary>
2022-09-27 20:12:13 +03:00
public interface IHasher : IPasswordHasher<ApplicationUser>
2022-09-26 04:40:18 +03:00
{
/// <summary>
/// Create hash
/// </summary>
/// <param name="text"></param>
/// <param name="algorithm"></param>
/// <returns></returns>
string CreateHash(string text, BaseCryptoItem.HashAlgorithm algorithm);
/// <summary>
/// Create hash
/// </summary>
/// <param name="text"></param>
/// <param name="salt"></param>
/// <param name="algorithm"></param>
/// <returns></returns>
string CreateHash(string text, string salt, BaseCryptoItem.HashAlgorithm algorithm);
/// <summary>
/// MatchesHash
/// </summary>
/// <param name="text"></param>
/// <param name="hash"></param>
/// <returns></returns>
bool MatchesHash(string text, string hash);
}