Files
BITKit/Src/Core/Crypto/Core/BITCrypto.cs
CortexCore 2c4710bc5d add kcp
2023-10-06 23:43:19 +08:00

21 lines
418 B
C#

using System;
using System.Security.Cryptography;
namespace BITKit.Crypto
{
public class BITCrypto:ICryptography
{
public string Salt { get; set; } = "2196F3";
public string Hash(string password)
{
var data = System.Text.Encoding.UTF8.GetBytes(password + Salt);
return Convert.ToBase64String(data);
}
public bool Verify(string password, string hash)
{
return Hash(password) == hash;
}
}
}