If you are calling ToString on a byte to convert it to a 2 digit hex value does it matter if you use a format provide of CultureInfo.CurrentCulture or CultureInfo.InvariantCulture in any way?
Example:
public string CalculateMD5Hash(string input)
{
MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
byte[] hash = md5.ComputeHash(inputBytes);
StringBuilder sb = new StringBuilder();
foreach (byte b in hash)
{
sb.Append(b.ToString("x2",CultureInfo.InvariantCulture));
}
return sb.ToString();
}
Basically can I leave out the IFormatProvider and always get the same result, or if I provide on of the CultureInfo defaults it will make a difference in the output?