Download KLExtensions source from www.o-townnet.tk. Then get PowerBASIC Windows compiler 7 from eMule. There is a file called hash.inc in the sources. Add to the biginning of the file:
Code:
#compile dll "hash.dll"
#include "win32api.inc"
The replace the line:
Code:
Function GetHash(ByVal sFileName As String, ByVal pbHash As Byte Ptr) As Long
with
Code:
Function GetHash(ByVal sFileName As String, ByVal pbHash As Byte Ptr) Export As Long
Then compile. It will generate a dll file called hash.dll.
The Visual Basic Declare should look as :
Code:
Declare Function GetHash LIB "Hash.dll" (sFileName As String, ByRef pbHash As Byte) As Integer
Example call:
Code:
Dim sFile as String
Dim bHash(1 To 20) as Byte
sFile = "MyFile.dat"
GetHash(sFile, bHash(1))
To encode to Base64 there is a function called Encode_BASE64 that do the job.
Rocko
Bookmarks