Private Sub MyButton_Click()
Dim Digest As MD5_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 digest
MD5_Calculate Digest, MyBinData(1), nLen
'Show the hexadecimal representation of the digest
MsgBox QHASH_ConvertToHex(Digest.Value(0), MD5_DIGESTSIZE, True)
End Sub
|