Answers for "c# system cryptography hash string"

C#
0

c# 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);
Posted by: Guest on August-07-2021

C# Answers by Framework

Browse Popular Code Answers by Language