当前位置:实例文章 » PHP实例» [文章]用VBS实现PHP的md5_file函数代码

用VBS实现PHP的md5_file函数代码

发布人:shili8 发布时间:2022-12-12 21:59 阅读次数:35

复制代码 代码如下:

function md5_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 = 3
stream.type = 1
stream.open
stream.loadfromfile filename
do until stream.eos
hasheddata.hash stream.read(1024)
loop
if raw_output then
md5_file = utility.hextobinary(hasheddata.value)
else
md5_file = hasheddata.value
end if
end function

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

相关标签:

免责声明

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱290110527@qq.com删除。

其他信息

其他资源

Top