No es necesario que sea un MD5, cualquier hash te valdria... claro, si lo haces tu hay que ir con cuidado, ya que puede darse el caso de que dos conjuntos de datos den el mismo hash... mira este algoritmo que acabo de hacer por ejemplo:
Private Sub Form_Load()
Dim bvTMP() As Byte
Call LoadFile("C:\WINDOWS\SYSTEM32\CALC.EXE", bvTMP)
Debug.Print Hex$(GetHash(bvTMP)),
Call LoadFile("C:\WINDOWS\SYSTEM32\NOTEPAD.EXE", bvTMP)
Debug.Print Hex$(GetHash(bvTMP))
End Sub
Public Function GetHash(ByRef bvArray() As Byte) As Double
Dim i As Long
For i = LBound(bvArray) To UBound(bvArray)
GetHash = GetHash + (bvArray(i) Xor (((GetHash And &HFFFF0000) \ &H10000) And &HFF))
Next i
End Function
Public Sub LoadFile(ByVal sPath As String, ByRef bvRET() As Byte)
Open sPath For Binary As #1
ReDim bvRET(0 To LOF(1) - 1)
Get #1, , bvRET
Close #1
End Sub
Es bastante rapido
Me parece una buena alternativa al MD5
Un codigo funcional para comparar:Option Explicit
'GDI32
Private Declare Function GetBitmapBits Lib "GDI32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Declare Function GetObject Lib "GDI32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Type BITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Private Sub GetBitmapData(ByVal pPIC As PictureBox, ByRef bvRet() As Byte)
Dim tBitmap As BITMAP
Call GetObject(pPIC.Image.Handle, Len(tBitmap), tBitmap)
ReDim bvRet(0 To (tBitmap.bmWidth * 4) * tBitmap.bmHeight) As Byte
Call GetBitmapBits(pPIC.Picture.Handle, UBound(bvRet), bvRet(0))
End Sub
Public Function GetHash(ByRef bvArray() As Byte) As Double
Dim i As Long
For i = LBound(bvArray) To UBound(bvArray)
GetHash = GetHash + (bvArray(i) Xor (((GetHash And &HFFFF0000) \ &H10000) And &HFF))
Next i
End Function
Private Sub Form_Load()
Dim p1() As Byte
Dim p2() As Byte
Call GetBitmapData(Picture1, p1)
Call GetBitmapData(Picture2, p2)
If GetHash(p1) = GetHash(p2) Then MsgBox "IGUALES!"
End Sub
Como dice Cobien es un gasto de memoria grande...