I'm using a static extension to convert a string to Sha256 as shown below:
public static string ToSha256(this string value)
{
var message = Encoding.ASCII.GetBytes(value);
SHA256Managed hashString = new SHA256Managed();
string hex = "";
var hashValue = hashString.ComputeHash(message);
foreach (byte x in hashValue)
{
hex += String.Format("{0:x2}", x);
}
return hex;
}
Notice the static keyword. What happens when two threads come in concurrently and modifies any of the internal variables in the function, will the outcome be affected?
Thanks