Oracle HASH

From Ittichai Chammavanijakul's Wiki
Revision as of 17:18, 31 October 2013 by Ittichai (talk | contribs) (Created page with "* ORA_HASH <pre> SQL> select ora_hash('abc') from dual; ORA_HASH('ABC') --------------- 1194017796 </pre> * dbms_crypto.hash In PL/SQL : dbms_crypto.hash('abc', DBMS_CRY...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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;