I have a C# string that has been built up with a stringbuilder. There are 2 lines that have the output:
Line1
Line2
I hash with this code:
public static string GetSha256Hash(string input)
{
using (SHA256 sha256Hash = SHA256.Create())
{
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
return Convert.ToBase64String(bytes);
}
}
CSPLite creates the correct following hash:
However C# creates a different hash due to the likely the line breaks that is handled differently
If I copy and paste the output of that same string, then i get the correct hash
How can I adapt the C# string in order to create the same hash as what CSP is creating?