当前位置: 移动技术网 > IT编程>脚本编程>VBScript > 用VBS模拟实现PHP的sha1_file函数效果代码

用VBS模拟实现PHP的sha1_file函数效果代码

2017年12月08日  | 移动技术网IT编程  | 我要评论

韩庚 快乐大本营,北京影讯,福元号

复制代码 代码如下:

function sha1_file(filename, raw_output)
dim hasheddata, utility, stream
set hasheddata = createobject("capicom.hasheddata")
set utility = createobject("capicom.utilities")
set stream = createobject("adodb.stream")
hasheddata.algorithm = 0
stream.type = 1
stream.open
stream.loadfromfile filename
do until stream.eos
hasheddata.hash stream.read(1024)
loop
if raw_output then
sha1_file = utility.hextobinary(hasheddata.value)
else
sha1_file = hasheddata.value
end if
end function

参考链接:
原文:http://demon.tw/programming/vbs-php-sha1_file.html

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网