How can I check/compare a files checksum?

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
cgar
Junior Member
Junior Member
Posts: 10
Joined: 2017-04-30, 21:38 UTC

How can I check/compare a files checksum?

Post by *cgar »

I've been using TC for a while now on my zenfone 2 since ES went way downhill. Really happy with it. Simply the best by far.

However, I can't find an option to check a file's checksum against one in the clipboard.

After some experimentation I have managed to create a new button that calculates an md5 and pops it up in a toast using:
Command: sh
Paramaters: md5sum "%N"

But it only displays it for a few seconds, comparison has to be made by eye and I can't copy it.

Have I missed it or is there no checksum functionality built in yet?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You can put a * in front of the parameters to show the results in a dialog box instead of a popup window. It also has a button to copy the text to the clipboard.
Author of Total Commander
https://www.ghisler.com
cgar
Junior Member
Junior Member
Posts: 10
Joined: 2017-04-30, 21:38 UTC

Post by *cgar »

ghisler(Author) wrote:You can put a * in front of the parameters to show the results in a dialog box […]
Ah that's fantastic thank you. So much better than eyeballing it lol.

Is there any way to compare a checksum? Is there a variable that dumps clipboard content? Then with the parameter of a button I could do something like:
md5sum -c <<< "%clip %N"

Edit: Woops sorry, too used to bash. For sh it would be:
echo "%clip %N" | md5sum -c -

Are there any plans for checksumming to be added fully? Like an option in the long press menu of a file opening a window with various hash algorithms and a paste box or file selector to input a hash or hashes to be compared?

Gotta say though, it's a great testament that because TC is so good even something that isn't built in can be so easily implimented by the user. Well done :-)
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

For my device, which doesn't have md5sum command, following button to show md5 works:
Function type:
Send Shell command
Command:
sh
Parameters:
*md5 "%N"
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
lbug
Junior Member
Junior Member
Posts: 24
Joined: 2015-10-08, 10:40 UTC

Re: How can I check/compare a files checksum?

Post by *lbug »

Hi,
I would REALLY like to see a full implementation of the checksum functionality - at least for MD5-sums. I.e., creating *.md5-files for directory contents or single files - AND checking these afterwards; like the Windows application does.

In many occasions I already needed this functionality but was never able to create / check checksum files. So I always had to create them on the Windows-PC, copy the whole data directory to the phone and hope that all is going right until I copy the files off the phone again, being able the check the sums on the receiving Windows machine. - That's no way to go with such untrustworthy media like SD cards. Until now I got lucky with my own phone but others weren't.

I wasn't happy with this for some time now. - But right now I'm in a really uneasy situation. My phone's internal storage got so filled up that it can't be connected to PCs anymore!? I even restarted the device several times, all seems to work fine (besides the "low storage" warning) but no Windows-PC is willing to connect it via USB anymore.
Normally this shouldn't be a problem, because I have enough free space on the installed SD card to move some stuff there. Quickly I found a directory with videos and photos. It already contains a MD5 checksum file which was created on Windows before. . . . And still, I don't have a means to check if this big directory's content was copied successfully before I delete the original.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How can I check/compare a files checksum?

Post by *ghisler(Author) »

There are already some apps which do this, e.g. this one:
https://play.google.com/store/apps/details?id=com.fab.md5
Author of Total Commander
https://www.ghisler.com
lbug
Junior Member
Junior Member
Posts: 24
Joined: 2015-10-08, 10:40 UTC

Re: How can I check/compare a files checksum?

Post by *lbug »

Sadly, this app does not fulfil any of the requirements.
It does not even support .md5-files with multiple lines!?
How should it support checksums of whole directory structures like the Windows-version of TotalCommander does?
(It also does not support to write .md5-files but I see that this is not the topic here.)

For me, there was no other solution than creating a big archive file of the directory I had to move. I was not awaiting any "attacks", so the CRC-32-checksum of the archive had to suffice. So I could at least check something before deleting the original.
I would still love to see the same functionality as with the Windows-version since I am copying lots of stuff between PC and Smartphone, in both directions.
Suncatcher
Junior Member
Junior Member
Posts: 18
Joined: 2013-12-30, 10:59 UTC

Re: How can I check/compare a files checksum?

Post by *Suncatcher »

And what about comparing files? I want compare two different files via checksum not against clipboard but between themselves? Can I do this just by right-click like I can do this in TC Desktop?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How can I check/compare a files checksum?

Post by *ghisler(Author) »

If the checksum is in the clipboard, you can use menu Files - Verify checksums to verify the checksum of the file under the cursor with the checksum from the clipboard.
Author of Total Commander
https://www.ghisler.com
Snapuman
Junior Member
Junior Member
Posts: 8
Joined: 2017-07-20, 13:37 UTC

Re: How can I check/compare a files checksum?

Post by *Snapuman »

I just stumbled about this because I was finally searching how I can verify a checksum in clipboard in Windows TC (v9.51) without first creating a file and saving the checksum inside, which always was annoying for me. Then I found this thread.

I tried this
ghisler(Author) wrote: 2019-06-17, 13:27 UTC If the checksum is in the clipboard, you can use menu Files - Verify checksums to verify the checksum of the file under the cursor with the checksum from the clipboard.
and ... magic! .. it works :) exactly what I always wanted (although the dialog is named "file - verify checksum (from checksum file)" -> which was the reason I never tried it to check against clipboard! -> And yes NOW I know it IS also described in the manual (and mostly I AM the manual reading guy! But in this special case, it was so obvious to me that it can't be done this way :roll: )

So @ghisler(Author) as suggestion for next version: Maybe name the dialog like "verify checksum (from checksum file/clipboard)" would be a lot more intuitive. Maybe I'm not the only one who don't know about this function? ^^
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: How can I check/compare a files checksum?

Post by *Hacker »

To anyone reading, some posts refer to the Windows version of TC, some to the Android version. I don't see how they could be reasonably split.

Hacker (Moderator)
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.
Snapuman
Junior Member
Junior Member
Posts: 8
Joined: 2017-07-20, 13:37 UTC

Re: How can I check/compare a files checksum?

Post by *Snapuman »

yeah that confused me at first a lot, too... took me a while to seperate them. :D

// meanwhile It's somewhat clear. I think it started with ghislers last answer to suncatcher's question (which was related for a solution to the android app). But ghisler came just up with the solution for the windows app without explicit mention that fact...

So maybe start there and just clarify in his post, that this solution is NOT for the android app (which this thread/question is about)?
Post Reply