title: What is the meaning of ToString("X2")?
body: <p>I'm studying MD5 encryption, and have found this code using Google:</p>
  <pre><code>public string CalculateMD5Hash(string input)
  {
  
      // Primeiro passo, calcular o MD5 hash a partir da string
      MD5 md5 = System.Security.Cryptography.MD5.Create();
      byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
      byte[] hash = md5.ComputeHash(inputBytes);
  
      // Segundo passo, converter o array de bytes em uma string haxadecimal
      StringBuilder sb = new StringBuilder();
      for (int i = 0; i &lt; hash.Length; i++)
      {
          sb.Append(hash[i].ToString(&quot;X2&quot;));
      }
      return sb.ToString();
  }
  </code></pre>
  <p>Why does it use <code>ToString(&quot;X2&quot;)</code>? How is it different from normal <code>ToString</code>?</p>