You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
429 B

using System.Security.Cryptography;
using System.Text;
3 years ago
namespace IdentityServer.Infrastructure.Converts;
public class PassWordConvert
{
public static string HashSHA256(string password)
{
var passwordByte = Encoding.UTF8.GetBytes(password);
var passWordHashByte = SHA256.HashData(passwordByte);
var passWordHash = Convert.ToBase64String(passWordHashByte);
return passWordHash;
}
}