title: Hashing and Converting To Base64 from C# to SQL
body: <p>I try to rewrite the following C# method to SQL Server 2014 code. So far to no avail.</p>
  
  <pre><code>public static string GetHash(string input)
  {
      HashAlgorithm hashAlgorithm = new SHA256CryptoServiceProvider();
  
      byte[] byteValue = System.Text.Encoding.UTF8.GetBytes(input);
      byte[] byteHash = hashAlgorithm.ComputeHash(byteValue);
  
      return Convert.ToBase64String(byteHash);
  }
  </code></pre>
  
  <p>Especially the encoding to UTF8 gives me trouble.</p>
  
  <p>I appreciate any help.</p>