title: Base64 encoding of a SHA256 string
body: <p>I am currently doing a program in C #. When I tried to pass my string from sha256 to base64, I realized that it was not being encoded correctly.</p>
  
  <p>For instance, given the sha256</p>
  
  <pre><code>cd69ef0284bba33bc0b320e6479c2da2d411a5e46af060d8639f0e0bfc24f26d
  </code></pre>
  
  <p>My code produces</p>
  
  <pre><code>Y2Q0Q2OUVGMDI4NEJCQTMzQkMwQjMyMEU2NDc5QzJEQTJENDExQTVFNDZBRjA2MEQ4NjM5RjBFMEJGQzI0RjI2RA==
  </code></pre>
  
  <p>What I'm expecting to get is</p>
  
  <pre><code>zWnvAoS7ozvAsyDmR5wtotQRpeRq8GDYY58OC/wk8m0
  </code></pre>
  
  <p>Why are encoded strings so different and what am I missing?</p>
  
  <p>This is the code I am using</p>
  
  <pre><code>string t1 ="cd69ef0284bba33bc0b320e6479c2da2d411a5e46af060d8639f0e0bfc24f26d";
  var t2= System.Text.Encoding.GetEncoding(1252).GetBytes(t1);                                
  string t3= System.Convert.ToBase64String(t2);
  </code></pre>