using System;
using System.Security.Cryptography;
using System.Text;

namespace Sicentury.Core.Extensions
{
    public static class Sha256Extension
    {
        public static string Sha256Encoding(this string strSource)
        {
            using (var sha = SHA256.Create())
            {
                var hashBytes = sha.ComputeHash(Encoding.UTF8.GetBytes(strSource));
                var hashStr = BitConverter.ToString(hashBytes).Replace("-", "");
                return hashStr;
            }
        }
    }
}
