Is there any hash function in PL/SQL? Is there any hash function in PL/SQL? oracle oracle

Is there any hash function in PL/SQL?


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.


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.