Compare by contents using MD5 (or others)

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Compare by contents using MD5 (or others)

Post 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
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Samuel
Power Member
Power Member
Posts: 1930
Joined: 2003-08-29, 15:44 UTC
Location: Germany, Brandenburg an der Havel
Contact:

Post by *Samuel »

Do it yourself. :-)

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

Edit:
cm_CompareByMD5
Overread that.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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.
Last edited by MVV on 2010-05-14, 07:29 UTC, edited 6 times in total.
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

It was requested before here
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post 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
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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!
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post 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
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Quick is nice !

Post 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
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post 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.
Heppchen
Junior Member
Junior Member
Posts: 39
Joined: 2009-07-01, 23:51 UTC
Location: Germany

Re: Compare by contents using MD5 (or others)

Post 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.
Post Reply