Private Sub MyButton_Click()
Dim Checksum As ADLER32_Digest
Dim MyStrData As String
MyStrData = "Hello World!"
Dim nLen As Long
nLen = Len(MyStrData)
'Convert the string to byte array
Dim MyBinData() As Byte
ReDim MyBinData(1 To nLen)
For i = 1 To nLen
MyBinData(i) = Asc(Mid(MyStrData, i, 1))
Next i
'Get the checksum
ADLER32_Calculate Checksum, MyBinData(1), nLen
'Show the hexadecimal representation of the checksum
MsgBox QHASH_ConvertToHex(Checksum.Value(0), ADLER32_DIGESTSIZE, True)
End Sub
|