Is there an MD5 Sum function in PL/SQL

这一生的挚爱 提交于 2019-12-04 03:40:05
René Nyffenegger

See this Tahiti Link. Under MD5 Procedures and Functions it says These subprograms generate MD5 hashes of data. The MD5 algorithm ensures data integrity by generating a 128-bit cryptographic message digest value from given data.

Also note, that DBMS_OBFUSCATION_TOOLKIT is deprecated and can/should be replaced with DBMS_CRYPTO, see this Tahiti Link

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.

In 12c you can use STANDARD_HASH. It's available by default, does not require any PL/SQL objects or hard-coded values, and is not deprecated.

SQL> select standard_hash('Finally, an easy way to do this.', 'MD5') md5
  2  from dual;

MD5
--------------------------------
456E4D024B4BB704169E21DEB895B0E2

don't think it comes with it right out of box. you need to define your own.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!