剑三爱萝莉下载:vb中md5 中对字符串的具体处理方法

来源:百度文库 编辑:高校问答 时间:2024/04/28 21:45:54
我看过这样一种处理:
Function MD5_Calc(ByVal hashthis As String) As String
ReDim buf(0 To 3) As String
ReDim Xin(0 To 15) As String
Dim tempnum As Integer, tempnum2 As Integer, loopit As Integer, loopou
ter As Integer, loopinner As Integer
Dim a As String, b As String, c As String, d As String

' Add padding

tempnum = 8 * Len(hashthis)
hashthis = hashthis + Chr$(128) 'Add binary 10000000
tempnum2 = 56 - Len(hashthis) Mod 64

If tempnum2 < 0 Then
tempnum2 = 64 + tempnum2
End If

hashthis = hashthis + String$(tempnum2, Chr$(0))

For loopit = 1 To 8
hashthis = hashthis + Chr$(tempnum Mod 256)
tempnum = tempnum - tempnum Mod 256
tempnum = tempnum / 256
Next loopit
我感觉不对,希望高手指点!!QQ170769378

这个不说好,太麻烦了,去问老师吧