oracle md5加密函数
1.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;
2.CREATE OR REPLACE
function getMD5 ( vin_string IN VARCHAR2 )
RETURN VARCHAR2 IS
temp varchar2(40);
BEGIN
temp := dbms_obfuscation_toolkit.MD5(input => utl_raw.cast_to_raw(vin_string));
RETURN '{MD5}'||utl_raw.cast_to_varchar2(utl_encode.base64_encode(temp));
END getMD5;