MD5 Component
Overview
The MD5 component uses the industry-standard MD5 checksum algorithm to get a fingerprint of a file. If you are storing files in a database, this component is a must. To avoid storing duplicate files in the database, store the MD5 checksum along with the file in the database. Every time you save a file, take an MD5 of the file and compare it to the list of MD5s stored in the database to see if this file is already stored. This component can be used in environments that support COM such as Active Server Pages, Windows Scripting Host, Visual Basic, etc.
- License
- Freeware
- Type
- ActiveX DLL for 32 bit OS
- Version
- 1.0
- File Name
- XMD5.dll
- Download Package
- x-md5.zip
Download
Download MD5 Component
Installation Instructions
- Move the dll to a directory like: C:\Program Files\XStandard\Bin\.
- Open a command prompt and
cd
to the directory where the dll is located. - Type regsvr32 XMD5.dll
- Grant "Read & Execute" file permissions on this dll to Everyone.
Note, on Microsoft Vista, the command prompt must be "Run as administrator" as shown in the screen shot below.
Uninstall Instructions
- Open a command prompt and
cd
to the directory where the dll is located. - Type regsvr32 -u XMD5.dll
API Reference: ProgID: XStandard.MD5
Function GetCheckSumFromFile(sPathName As String) As String
Return checksum of a file
Function GetCheckSumFromString(sString As String) As String
Return checksum of a string
Examples
The examples below are for Active Server Pages. For Windows Scripting Host or Visual Basic, replace Server.CreateObject
with CreateObject
and replace Resonse.Write
with MsgBox
.
Check if two files are identical
<%
Dim objMD5, strFingerPrint1, strFingerPrint2
Set objMD5 = Server.CreateObject("XStandard.MD5")
strFingerPrint1 = objMD5.GetCheckSumFromFile("C:\Temp\file1.jpg")
strFingerPrint2 = objMD5.GetCheckSumFromFile("C:\Temp\file2.jpg")
If strFingerPrint1 = strFingerPrint2 Then
Response.Write "Files are identical!"
Else
Response.Write "Files are different!"
End If
Set objMD5 = Nothing
%>