Hello agraham,
thanks for the lib.Works great.I use now this procedure / sub to calculate the MD5 of a string:
Sub Globals
...
Dim data()
Dim hash()
...
End Sub
Sub StringToMD5(string)
Bit.New1
MD5.New1
data() = bit.StringToBytes(string, 0, StrLength(string))
' ComputeHash(byte array, start index, count)
hash() = MD5.ComputeHash(data(), 0, ArrayLen(data()))
str = ""
For i = 0 To ArrayLen(hash())-1
If hash(i) < 16 Then
str = str & "0"
End If
str = str & bit.DecToHex(hash(i))
Next
Return str
So this is then like a blackbox.I don't want to know what's in there, just need to know what comes out if i put in something..
) Just like this:
MD5HashOfSomeThing = StringToMD5(string)
Question: can you include this into the lib..? It would be handy if one just calls the lib function this way, without this code around, like this:
Sub MySub
Bit.New1
MD5.New1
MD5HashStringofmyString = MD5.StringToMD5(string)
End Sub
Another question:
The auto completion revealed to me your MD5 lib has these functions:
md5.New1
md5.ComputeHash
md5.ToString
md5.Dispose
What does the .ToString do..? Is it the same like this code does...? :
str = ""
For i = 0 To ArrayLen(hash())-1
If hash(i) < 16 Then
str = str & "0"
End If
str = str & bit.DecToHex(hash(i))
Next
Return str
Nevertheless your lib and the code for conversion to Hex string works fine so far..!
Cheers
TWELVE