mysql> select MD5(15201061106);
+----------------------------------+
| MD5(15201061106) |
+----------------------------------+
| ba726d7afbda0488aee313ed5cf31270 |
+----------------------------------+
1 row in set (0.00 sec)
CREATE OR REPLACE FUNCTION MD5(passwd IN VARCHAR2)
RETURN VARCHAR2 IS
retval varchar2(32);
BEGIN
retval := utl_raw.cast_to_raw(DBMS_OBFUSCATION_TOOLKIT.MD5(INPUT_STRING => passwd));
RETURN retval;
END;
Oracle>select MD5(15201061106) from dual;
MD5(15201061106)
----------------------------------------------
BA726D7AFBDA0488AEE313ED5CF31270
这个字符串实际上是16个字节的值用十六进制表示的结果,其中的字符是0-9和A-F,正因为如此,其中的字母大小写是无关的,都表示同一个值。
create or replace function cif_base_kk.MD5(
pass in varchar2)
return varchar2 is
retval varchar2(32);
begin
if pass is null then
return null;
end if;
retval := utl_raw.cast_to_raw(dbms_obfuscation_toolkit.MD5(input_string => pass));
return retval;
end;