Is there any hash function in PL/SQL?

倖福魔咒の 提交于 2019-11-28 10:57:13

Make sure that you have the appropriate permissions granted to the user that you are connecting with. Talk to your DBA to add the execute permission on the SYS.DBMS_CRYPTO package.

Oracle provides a nice guide on working with hashed and encrypted data using the oracle database.

If you are on an older version of the database that doesn't support DBMS_CRYPTO, you can also try DBMS_OBFUSCATION_TOOLKIT.

In Oracle 12c you can use the function STANDARD_HASH.

Depending on why you're trying to generate the hash, the built-in function ORA_HASH may be sufficient,

SQL> select ora_hash( 'fuzzy bunny' ) from dual;

ORA_HASH('FUZZYBUNNY')
----------------------
            2519249214

I wouldn't try to use this if you need a cryptographically secure hash function. But if you just need a simple hash, this should be sufficient.

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