csharp system cryptography hash string

Code Example - csharp system cryptography hash string

                
                        public static string StringSha256Hash(string text) =>
        string.IsNullOrEmpty(text) ?
      	string.Empty : // Return string back if its empty
			BitConverter.ToString( // Encrypt
              new System.Security.Cryptography.SHA256Managed().ComputeHash(
              System.Text.Encoding.UTF8.GetBytes(text))
            ).Replace("-", string.Empty);