public static Hash ( this clear_text ) : string | ||
clear_text | this | |
return | string |
public static string Hash(this string clear_text)
{
using (HashAlgorithm hash = new SHA256CryptoServiceProvider())
{
return Convert.ToBase64String(hash.ComputeHash(Encoding.UTF8.GetBytes(clear_text)));
}
}