复制代码 代码如下:
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加密功能示例
声明:本站(华域联盟www.cnhackhy.com)所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

评论(0)