oracle md5码获取,oracle md5 加密函数

源代码:CREATE OR REPLACE FUNCTION fn_md5 (input_string IN VARCHAR2)

RETURN VARCHAR2

IS

raw_input                        RAW (128)

:= UTL_RAW.cast_to_raw (input_string);

decrypted_raw                    RAW (2048);

error_in_input_buffer_length     EXCEPTION;

BEGIN

DBMS_OBFUSCATION_TOOLKIT.md5 (input => raw_input,

checksum => decrypted_raw

);

RETURN LOWER (RAWTOHEX (decrypted_raw));

END;

/

相同的

pl/sql版 CREATE OR REPLACE function md5(input_string VARCHAR2) return varchar2

IS

raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(input_string);

decrypted_raw RAW(2048);

error_in_input_buffer_length EXCEPTION;

BEGIN

sys.dbms_obfuscation_toolkit.MD5(input => raw_input, checksum => decrypted_raw);

return lower(rawtohex(decrypted_raw));

END;

你可能感兴趣的:(oracle,md5码获取)