Sto provando a confrontare un checksum MD5 generato da PHP a uno generato da Oracle 10g. Tuttavia sembra che sto confrontando le mele con le arance.Come ottenere MD5 di Oracle in modo che corrisponda all'MD5 di PHP
Ecco quello che ho fatto per testare il confronto:
//md5 tests
//php md5
print md5('testingthemd5function');
print '<br/><br/>';
//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];
La funzione md5 (visto nella query sopra) in Oracle utilizza il pacchetto 'dbms_obfuscation_toolkit.md5' e viene definito come questo (?):
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 => v_input_string);
return v_checksum;
end;
quello che esce sulla mia pagina PHP è:
29dbb90ea99a397b946518c84f45e016
)Û¹©š9{”eÈOEà
qualcuno mi può aiutare a get ting i due per abbinare?
grazie, che ha funzionato come un fascino – Zenshai