pl/sql版
CREATE
OR
REPLACE
function md5(input_string
VARCHAR2)
return
varchar2
IS
![](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
raw_input
RAW(
128) :
= UTL_RAW.CAST_TO_RAW(input_string);
![](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
decrypted_raw
RAW(
2048);
![](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
error_in_input_buffer_length EXCEPTION;
BEGIN
![](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
sys.dbms_obfuscation_toolkit.MD5(input
=> raw_input, checksum
=> decrypted_raw);
return
lower(rawtohex(decrypted_raw));
END;
from: unknown
Java版
from: appfuse
python版
1
import md5
2
3
![](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
m = md5.new()
4
![](https://i-blog.csdnimg.cn/blog_migrate/4f1150b881333f12a311ae9ef34da474.gif)
m.update(
"
water
")
5
print m.hexdigest()