I try to hash a string using SHA256, I\'m using the following code:
using System; using System.Security.Cryptography; using System.Text; public class Hash
The shortest and fastest way ever. Only 1 line!
public static string StringSha256Hash(string text) => string.IsNullOrEmpty(text) ? string.Empty : BitConverter.ToString(new System.Security.Cryptography.SHA256Managed().ComputeHash(System.Text.Encoding.UTF8.GetBytes(text))).Replace("-", string.Empty);