Getting Oracle's MD5 to match PHP's MD5
Create a function like the following:
create or replacefunction md5( input varchar2 ) return sys.dbms_obfuscation_toolkit.varchar2_checksum asbegin return lower(rawtohex(utl_raw.cast_to_raw(sys.dbms_obfuscation_toolkit.md5( input_string => input ))));end;
and call it like this:
select md5('foobar') from dual;
it seems that "dbms_obfuscation_toolkit.md5" does not really return in raw format, hence the need to call "utl_raw.cast_to_raw". I could be wrong though, there should be a better explanation for this.