Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

M d 5 hash issue with DBMS_CRYPTO.HASH

463428May 11 2009 — edited May 12 2009
Needs help in resolving the Md5 issue.

when I use the below queries (in oracle & sqlserver) it gives me the different results, as seen.
however both these queries are right, I have tested these with different hard coded values like 'aak', '1001', 'hello' etc the v_hash results are same,
But when I used them with the table and see the result is different as below.

can any one tell me where I am wrong.


SELECT TO_NUMBER(V_ID),V_NAME,DBMS_CRYPTO.HASH(UTL_RAW.CAST_TO_RAW(TRIM(V_NAME)),2) as v_hash FROM VENDORS
--in Oracle
v_id v_name v_hash
1 LLC-伊藤忠テクノサイエンス(株)X 2B88674674938AD2B0AEA8ED0692147D


SELECT V_ID, VENDOR_NAME,HASHBYTES('MD5',LTRIM(RTRIM(V_NAME))) as v_hash FROM VENDORS
--in Sqlserver
v_id v_name v_hash
1 0x425185D702007AA6BF1D61E086A9B293 LLC-伊藤忠テクノサイエンス(株)X

regards,
aak.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2009
Added on May 11 2009
13 comments
2,118 views