Oracle HASH

From Ittichai Chammavanijakul's Wiki
Jump to: navigation, search
  • ORA_HASH
SQL> select ora_hash('abc') from dual;

ORA_HASH('ABC')
---------------
     1194017796
  • dbms_crypto.hash

In PL/SQL

dbms_crypto.hash('abc', DBMS_CRYPTO.hash_sh1)

Or in SQL

SQL> select dbms_crypto.hash('abc', 3) from dual
  2  ;

DBMS_CRYPTO.HASH('ABC',3)
--------------------------------------------------------------------------------
C714CC5367F7592793BBA0B9024C34CDE763E153

The argument is based on

HASH_MD4 CONSTANT PLS_INTEGER := 1;

HASH_MD5 CONSTANT PLS_INTEGER := 2;

HASH_SH1 CONSTANT PLS_INTEGER := 3;