本篇内容主要讲解“如何用VBS实现PHP的sha1_file函数效果”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“如何用VBS实现PHP的sha1_file函数效果”吧!
复制代码 代码如下:
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
到此,相信大家对“如何用VBS实现PHP的sha1_file函数效果”有了更深的了解,不妨来实际操作一番吧!这里是编程网网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!