复制代码 代码如下:
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
您可能感兴趣的文章:
- php中可能用来加密字符串的函数[base64_encode、urlencode、sha1]
- PHP实现加密的几种方式介绍
- 2个比较经典的PHP加密解密函数分享
- php中base64_decode与base64_encode加密解密函数实例
- PHP中加密解密函数与DES加密解密实例
- php中AES加密解密的例子小结
- PHP可逆加密/解密函数分享
- PHP 加密解密内部算法
- php基于mcrypt的加密解密实例
- php 的加密函数 md5,crypt,base64_encode 等使用介绍
- php rsa加密解密使用详解
- PHP实现的简单sha1加密功能示例
本文由 华域联盟 原创撰写:华域联盟 » 用VBS模拟实现PHP的sha1_file函数效果代码
转载请保留出处和原文链接:https://www.cnhackhy.com/15999.htm