FileComparator is a simple C++ program that compares two files by computing their MD5 hash values and outputs the percentage difference between the hashes.
- Computes the MD5 hash of two files.
- Outputs the hash values of both files.
- Calculates and displays the percentage difference between the two hash values.
- Visual Studio with C++ development tools.
- OpenSSL installed via vcpkg.
-
Install vcpkg:
git clone https://github.com/microsoft/vcpkg.git cd vcpkg .\bootstrap-vcpkg.bat
-
Install OpenSSL via vcpkg:
.\vcpkg install openssl:x64-windows
-
Clone the Repository:
git clone https://github.com/your-username/FileComparator.git cd FileComparator
-
Open the x64 Native Tools Command Prompt for Visual Studio.
-
Set OpenSSL Environment Variables:
set OPENSSL_ROOT_DIR=C:\path\to\vcpkg\installed\x64-windows set OPENSSL_INCLUDE_DIR=%OPENSSL_ROOT_DIR%\include set OPENSSL_LIB_DIR=%OPENSSL_ROOT_DIR%\lib
-
Compile the Program:
cl /EHsc /MD /I"%OPENSSL_INCLUDE_DIR%" compare_files.cpp /link /LIBPATH:"%OPENSSL_LIB_DIR%" libssl.lib libcrypto.lib /MACHINE:X64 /out:compare_files.exe
Run the executable with two file paths as arguments:
compare_files.exe file1.txt file2.txt
File 1 MD5: d41d8cd98f00b204e9800998ecf8427e
File 2 MD5: 0cc175b9c0f1b6a831c399e269772661
Percentage difference: 62.5%
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please fork this repository and submit pull requests.