Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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);
 
PREVIOUS NEXT
Tagged: #system #cryptography #hash #string
ADD COMMENT
Topic
Name
4+2 =