title: Getting Oracle's MD5 to match PHP's MD5
body: <p>I'm trying to compare an MD5 checksum generated by PHP to one generated by Oracle 10g. However it seems I'm comparing apples to oranges.</p>
  
  <p>Here's what I did to test the comparison:</p>
  
  <pre><code>//md5 tests
  
    //php md5
    print md5('testingthemd5function');
  
    print '&lt;br/&gt;&lt;br/&gt;';
  
    //oracle md5
    $md5query = "select md5hash('testingthemd5function') from dual";
  
    $stid = oci_parse($conn, $md5query);
    if (!$stid) {
     $e = oci_error($conn);
     print htmlentities($e['message']);
     exit;
    }
  
    $r = oci_execute($stid, OCI_DEFAULT);
    if (!$r) {
     $e = oci_error($stid);
     echo htmlentities($e['message']);
     exit;
    }
  
    $row = oci_fetch_row($stid); 
    print $row[0];
  </code></pre>
  
  <p>The md5 function (seen in the query above) in Oracle uses the 'dbms_obfuscation_toolkit.md5' package(?) and is defined like this:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION PORTAL.md5hash (v_input_string in varchar2) return varchar2     
  is
     v_checksum varchar2(20);
     begin
     v_checksum := dbms_obfuscation_toolkit.md5 (input_string =&gt; v_input_string);
     return v_checksum;
  end;
  </code></pre>
  
  <p>What comes out on my PHP page is:</p>
  
  <pre><code>29dbb90ea99a397b946518c84f45e016
  
  )Û¹©š9{”eÈOEà 
  </code></pre>
  
  <p>Can anyone help me in getting the two to match?</p>