Is there an MD5 Sum function in PL/SQL

Bob Kuhar picture Bob Kuhar · Jan 11, 2012 · Viewed 35.1k times · Source

In Oracle SQL, is there an MD5 function or something available to me? I would like to do something like...

select name, md5_sum( name ) from person;

Answer

Eddie Awad picture Eddie Awad · Jan 11, 2012

You may want to check the DBMS_OBFUSCATION_TOOLKIT.MD5 procedure.

Here is an example:

     SQL> column md5_val FORMAT A40
     SQL> SELECT DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw('Eddie')) md5_val
       2    FROM DUAL;
     MD5_VAL
     ----------------------------------------
     E5F6C83E6E97C74FC9E9760FC8972AED

     1 row selected.