Page 1 of 1

Compare by contents using MD5 (or others)

Posted: 2010-05-13, 19:42 UTC
by Hacker
Hi,
I would really welcome the possibility to compare two files using a checksum, just to know if they are equal or not. This is because I often compare two DVD ISO images (4,7 GB) and using Files - Compare by content it takes forever, so I usually resort to creating an MD5 checksum for one, editing the .md5 file to change the filename and verifying the other file. I would suggest an internal command like cm_CompareByMD5 which would just tell me if files are identical or different (the strings are already there).

Thanks for consideration.

Roman

Posted: 2010-05-14, 06:17 UTC
by Samuel
Do it yourself. :-)

With the new Content plugins with compare function (for sync).

Edit:
cm_CompareByMD5
Overread that.

Posted: 2010-05-14, 06:42 UTC
by MVV
Also external compare tool (or just simple batch or script that will call MD5 calculator for both files and compare results) may help.

E.g.:

Code: Select all

@echo off
if -%2==- goto exit
if %1==%2 goto exit

set md5~1="%temp%\md5~1.txt"
set md5~2="%temp%\md5~2.txt"

echo File1: %1
echo File2: %2
%0\..\md5.exe -n %1>%md5~1%
%0\..\md5.exe -n %2>%md5~2%
echo.
echo MD5 checksums for files:
type %md5~1%
type %md5~2%

echo.
fc %md5~1% %md5~2%>nul
if errorlevel 1 echo [X] Files have different contents!
if not errorlevel 1 echo [ ] Files have same MD5 checksums.
pause>nul

del %md5~1%
del %md5~2%

:exit
cls
For tool that may be downloaded here.

Button parameters may be any needed, e.g.:

Code: Select all

%P%S2 %T%R1
This will compare two selected files from active panel, or selected one in active with selected one in inactive - i.e. as for internal TC compare tool.

Posted: 2010-05-14, 06:50 UTC
by ts4242
It was requested before here

Posted: 2010-05-14, 07:49 UTC
by Hacker
MVV,
Thank you for the workaround. I'd still love to see it implemented internally. :)

ts4242,
Indeed, but I do not need the compare function to be started to show me the differences. For my needs it is only necessary to find out if files are equal or not.

Roman

Posted: 2010-05-14, 08:16 UTC
by MVV
Hacker wrote:I'd still love to see it implemented internally. :)
I think that internally should be implemented features that can't be implemented externally. If feature may be easilly implemented by little external tool, why not to use it?

BTW using some script (e.g. WHS) you may show standard GUI message instead of console window - exactly like internal solution!

Posted: 2010-05-14, 11:21 UTC
by Hacker
MVV,
I think that internally should be implemented features that can't be implemented externally.
Ah, the age old debate. Because it might be useful to others as well. Because I do not want to fiddle around with dozens of checksum tools to find the fastest one. Because I do not want console windows to pop up or have the need to hide them programatically. Because I want to see the progress in the taskbar. Because it is something which should be very easy to implement, perhaps faster than me programming a workaround.

Anyways. :)

Roman

Quick is nice !

Posted: 2010-05-14, 15:48 UTC
by Clo
2Hacker

:) Hi Roman !

• I support your proposal as a built-in feature.
- I guess that a quick comparison using checksums should be very convenient in many cases, I would certainly use it often !

:mrgreen: KR
Claude
Clo

Posted: 2010-05-14, 17:44 UTC
by Balderstrom
Support,
Should allow for any of the CheckSum's that TC can already use: CRC or MD5. Granted CRC is not as good as MD5 -- sometimes it is good enough.

Could also use a generated MD5 | CRC file list (text file)
Any file's whose date is OLDER than the generated MD5|CRC text file would consider it's pregenerated value in the text file as valid.

I.E if you generate an MD5/CRC file list "Now". and all your files are older than "Now", then all the Checksums in the text file would be considered current/valid.

Which leads to a further function, the Compare could use a recalculate checksum first -- but only need to recalculate the files that have a newer date than the checksum file itself.

Re: Compare by contents using MD5 (or others)

Posted: 2010-05-24, 03:24 UTC
by Heppchen
Hacker wrote:Hi,
I would really welcome the possibility to compare two files using a checksum, just to know if they are equal or not. This is because I often compare two DVD ISO images (4,7 GB) and using Files - Compare by content it takes forever, so I usually resort to creating an MD5 checksum for one, editing the .md5 file to change the filename and verifying the other file. I would suggest an internal command like cm_CompareByMD5 which would just tell me if files are identical or different (the strings are already there).
I guess I didn't get the entire request ;) but why don't you use SyncDir to see whether files are equal or not? If they are not equal you can press CTRL+F3 for comparison.

Ok, this is not a solution if you need checksums for archiving purposes. Sorry.