ITPub博客

首页 > 数据库 > 数据库开发技术 > 使用SQL函数对字符串进行MD5/SHA1加密

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

原创 数据库开发技术 作者:szfengyuan 时间:2009-02-11 16:44:28 0 删除 编辑

一:加密函数: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中

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8203566/viewspace-1017207/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2010-01-16

  • 博文量
    3
  • 访问量
    6163