用VBS模擬實現(xiàn)PHP的sha1_file函數(shù)效果代碼
更新時間:2011年01月21日 22:53:23 作者:
用VBS模擬實現(xiàn)PHP的sha1_file函數(shù)效果代碼,需要的朋友可以參考下。
復制代碼 代碼如下:
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)文章
VBScript教程 第二課在HTML頁面中添加VBscript代碼
VBScript教程 第二課在HTML頁面中添加VBscript代碼...2006-11-11VBS基礎(chǔ)篇 - vbscript Dictionary對象
Dictionary是存儲數(shù)據(jù)鍵和項目對的對象,其主要屬性有Count、Item、Key,主要方法有Add、Exists、Items、Keys、Remove、RemoveAll2018-05-05ActiveX部件不能創(chuàng)建對象:dm.dmsoft代碼:800A01AD
vbs調(diào)用插件報:ActiveX部件不能創(chuàng)建對象,代碼:800A01AD,一般是因為病毒導致dll文件丟失或者64系統(tǒng)問題導致,需要的朋友可以參考下2019-12-12