用VBS模擬實現(xiàn)PHP的sha1_file函數(shù)效果代碼
更新時間:2011年01月21日 22:53:23 作者:
用VBS模擬實現(xiàn)PHP的sha1_file函數(shù)效果代碼,需要的朋友可以參考下。
復(fù)制代碼 代碼如下:
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中可能用來加密字符串的函數(shù)[base64_encode、urlencode、sha1]
- PHP實現(xiàn)加密的幾種方式介紹
- 2個比較經(jīng)典的PHP加密解密函數(shù)分享
- php中base64_decode與base64_encode加密解密函數(shù)實例
- PHP中加密解密函數(shù)與DES加密解密實例
- php中AES加密解密的例子小結(jié)
- PHP可逆加密/解密函數(shù)分享
- PHP 加密解密內(nèi)部算法
- php基于mcrypt的加密解密實例
- php 的加密函數(shù) md5,crypt,base64_encode 等使用介紹
- php rsa加密解密使用詳解
- PHP實現(xiàn)的簡單sha1加密功能示例
相關(guān)文章
如何通過計劃任務(wù)調(diào)用QuickTest測試腳本
如何通過計劃任務(wù)調(diào)用QuickTest測試腳本...2007-03-03
VBS腳本實現(xiàn)遍歷批量替換多目錄多文件內(nèi)容的代碼
這篇文章主要介紹了VBS腳本實現(xiàn)遍歷批量替換多目錄多文件內(nèi)容的代碼,主要是結(jié)合了bat,實現(xiàn)這種效果,需要的朋友可以參考一下2018-12-12
VBS教程:VBscript語句-For Each...Next 語句
VBS教程:VBscript語句-For Each...Next 語句...2006-11-11

