SQL>
SQL> CREATE OR REPLACE FUNCTION get_hash_val (p_in VARCHAR2)
2 RETURN VARCHAR2
3 IS
4 l_hash VARCHAR2 (2000);
5 BEGIN
6 l_hash :=RAWTOHEX(UTL_RAW.cast_to_raw(DBMS_OBFUSCATION_TOOLKIT.md5 (input_string=> p_in)));
7 RETURN l_hash;
8 END;
9 /
Function created.
SQL>
SQL> select get_hash_val('12345') from dual;
GET_HASH_VAL('12345')
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
827CCB0EEA8A706C4C34A16891F84E7B
SQL>
|