手机
当前位置:查字典教程网 >脚本专栏 >vbs >用VBS模拟实现PHP的sha1_file函数效果代码
用VBS模拟实现PHP的sha1_file函数效果代码
摘要:复制代码代码如下:Functionsha1_file(filename,raw_output)DimHashedData,Utility,S...

复制代码 代码如下:

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

参考链接:HashedData Object

原文:http://demon.tw/programming/vbs-php-sha1_file.html

【用VBS模拟实现PHP的sha1_file函数效果代码】相关文章:

用vbs实现的exe2swf工具脚本代码

用VBS实现PHP的md5_file函数代码

用vbs确定用户的登录名的代码

WMI 创建系统服务的实现代码(Automatic)

利用WMI实现系统补丁检测分析

利用vbs类实现css按钮的代码

VBS教程:函数-Weekday 函数

用vbs实现枚举网络连接的代码

VBS教程:函数-Sgn 函数

好玩的vbs特色代码第1/6页

精品推荐
分类导航