使用SQL函数对字符串进行MD5/SHA1加密

来源:互联网 发布:js对象数组删除元素 编辑:程序博客网 时间:2024/06/05 03:04

 

一:加密函数:hashbytes('type','string')

如select hashbytes('md5','123') /得出得用MD5对123加密后的乱码。

select hashbytes('sha1','123') /得出利用SHA1对123加密后的乱码。

二:字符转换函数:xp_varbintohexstr('string') / fn_varbintohexstr('string')

如:select xp_varbintohexstr(hashbytes('md5','123')) /2000中

select fn_varbintohexstr(hashbytes('md5','123')) /2005中

原创粉丝点击