title: php md5 algorithm that gives same result as c#
body: <p>i have a hashing algorithm in C#, in a nutshell, it is:</p>
  
  <pre><code>string input = "asd";
  
  System.Security.Cryptography.MD5 alg = System.Security.Cryptography.MD5.Create();
  System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
  
  
  byte[] hash = alg.ComputeHash(enc.GetBytes(input));
  string output = Convert.ToBase64String(hash);
  
  // outputs:   eBVpbsvxyW5olLd5RW0zDg==
  Console.WriteLine(output);
  </code></pre>
  
  <p>Now I need to replicate this behaviour in php, </p>
  
  <pre><code>$input = "asd";
  $output = HashSomething($input);
  echo $output;
  </code></pre>
  
  <p>How can I achieve it?</p>
  
  <p>I checked </p>
  
  <ul>
  <li>md5</li>
  <li>utf8_decode</li>
  <li>utf8_encode</li>
  <li>base64_encode</li>
  <li>base64_decode</li>
  <li>url_decode</li>
  </ul>
  
  <p>but i noted the php md5 doesn't get the == on the end... what am I missing?</p>
  
  <p><em>NOTE</em>: I cannot change C# behaviour because it's already implemented and passwords saved in my db with this algorithm.</p>