'HASH MD5
Private Const S11 = &H007
Private Const S12 = &H00C
Private Const S13 = &H011
Private Const S14 = &H016
Private Const S21 = &H005
Private Const S22 = &H009
Private Const S23 = &H00E
Private Const S24 = &H014
Private Const S31 = &H004
Private Const S32 = &H00B
Private Const S33 = &H010
Private Const S34 = &H017
Private Const S41 = &H006
Private Const S42 = &H00A
Private Const S43 = &H00F
Private Const S44 = &H015
Class MD5
' Public methods and properties
' Text property
Public Text
' Text value in Hex, read-only
Public Property Get HEXMD5()
Dim lArray
Dim lIndex
Dim AA
Dim BB
Dim CC
Dim DD
Dim lStatus0
Dim lStatus1
Dim lStatus2
Dim lStatus3
lArray = ConvertToWordArray(Text)
lStatus0 = &H67452301
lStatus1 = &HEFCDAB89
lStatus2 = &H98BADCFE
lStatus3 = &H10325476
For lIndex = 0 To UBound(lArray) Step 16
AA = lStatus0
BB = lStatus1
CC = lStatus2
DD = lStatus3
FF lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 0), S11,&HD76AA478
FF lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 1), S12,&HE8C7B756
FF lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 2), S13,&H242070DB
FF lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 3), S14,&HC1BDCEEE
FF lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 4), S11,&HF57C0FAF
FF lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 5), S12,&H4787C62A
FF lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 6), S13,&HA8304613
FF lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 7), S14,&HFD469501
FF lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 8), S11,&H698098D8
FF lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 9), S12,&H8B44F7AF
FF lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 10), S13,&HFFFF5BB1
FF lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 11), S14,&H895CD7BE
FF lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 12), S11,&H6B901122
FF lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 13), S12,&HFD987193
FF lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 14), S13,&HA679438E
FF lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 15), S14,&H49B40821
GG lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 1), S21,&HF61E2562
GG lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 6), S22,&HC040B340
GG lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 11), S23,&H265E5A51
GG lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 0), S24,&HE9B6C7AA
GG lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 5), S21,&HD62F105D
GG lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 10), S22,&H2441453
GG lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 15), S23,&HD8A1E681
GG lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 4), S24,&HE7D3FBC8
GG lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 9), S21,&H21E1CDE6
GG lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 14), S22,&HC33707D6
GG lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 3), S23,&HF4D50D87
GG lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 8), S24,&H455A14ED
GG lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 13), S21,&HA9E3E905
GG lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 2), S22,&HFCEFA3F8
GG lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 7), S23,&H676F02D9
GG lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 12), S24,&H8D2A4C8A
HH lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 5), S31,&HFFFA3942
HH lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 8), S32,&H8771F681
HH lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 11), S33,&H6D9D6122
HH lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 14), S34,&HFDE5380C
HH lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 1), S31,&HA4BEEA44
HH lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 4), S32,&H4BDECFA9
HH lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 7), S33,&HF6BB4B60
HH lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 10), S34,&HBEBFBC70
HH lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 13), S31,&H289B7EC6
HH lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 0), S32,&HEAA127FA
HH lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 3), S33,&HD4EF3085
HH lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 6), S34,&H4881D05
HH lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 9), S31,&HD9D4D039
HH lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 12), S32,&HE6DB99E5
HH lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 15), S33,&H1FA27CF8
HH lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 2), S34,&HC4AC5665
II lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 0), S41,&HF4292244
II lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 7), S42,&H432AFF97
II lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 14), S43,&HAB9423A7
II lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 5), S44,&HFC93A039
II lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 12), S41,&H655B59C3
II lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 3), S42,&H8F0CCC92
II lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 10), S43,&HFFEFF47D
II lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 1), S44,&H85845DD1
II lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 8), S41,&H6FA87E4F
II lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 15), S42,&HFE2CE6E0
II lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 6), S43,&HA3014314
II lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 13), S44,&H4E0811A1
II lStatus0,lStatus1,lStatus2,lStatus3,lArray(lIndex + 4), S41,&HF7537E82
II lStatus3,lStatus0,lStatus1,lStatus2,lArray(lIndex + 11), S42,&HBD3AF235
II lStatus2,lStatus3,lStatus0,lStatus1,lArray(lIndex + 2), S43,&H2AD7D2BB
II lStatus1,lStatus2,lStatus3,lStatus0,lArray(lIndex + 9), S44,&HEB86D391
lStatus0 = Add32(lStatus0,AA)
lStatus1 = Add32(lStatus1,BB)
lStatus2 = Add32(lStatus2,CC)
lStatus3 = Add32(lStatus3,DD)
Next
HEXMD5 = LCase(WordToHex(lStatus0) & WordToHex(lStatus1) & WordToHex(lStatus2) & WordToHex(lStatus3))
End Property