[TC11.51 RC2] Checksum verification

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Infector
Junior Member
Junior Member
Posts: 47
Joined: 2005-11-22, 12:48 UTC
Location: Russia

[TC11.51 RC2] Checksum verification

Post by *Infector »

I have an sfv file where the leading zero in the checksum was somehow lost (4519F2F instead of 04519F2F). In this case, if 123.mp3 exist or not, TC give the same result:

Code: Select all

123.sfv:
Errors: 0
OK: 0, not found: 0, read error: 0, wrong checksum: 0
If the leading zero was returned into the sfv file I am getting expected result "Cannot open input file"

Code: Select all

123.sfv:
Cannot open input file 123.mp3!
Errors: 1
OK: 0, not found: 1, read error: 0, wrong checksum: 0
I also noticed a strange behaviour, if I rename the file to test.mp3 (whether the file exists on fs or not) with a checksum of 4519F2F in sfv, I get:

Code: Select all

Cannot open input file 4519F2F!.
Errors: 1
OK: 0, not found: 1, read error: 0, wrong checksum: 0
If leading zero was returned in the sfv file, the result for test.mp3 is correct

Code: Select all

123.sfv:
Cannot open input file test.mp3!
Errors: 1
OK: 0, not found: 1, read error: 0, wrong checksum: 0
User avatar
white
Power Member
Power Member
Posts: 5743
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC11.51 RC2] Checksum verification

Post by *white »

Infector wrote: 2025-01-25, 13:00 UTC I have an sfv file where the leading zero in the checksum was somehow lost (4519F2F instead of 04519F2F). In this case, if 123.mp3 exist or not, TC give the same result:
Note that if checksums don't have the correct length, TC will not recognize them as such and treat the line as comment.

Infector wrote: 2025-01-25, 13:00 UTC I also noticed a strange behaviour, if I rename the file to test.mp3 (whether the file exists on fs or not) with a checksum of 4519F2F in sfv, I get:

Code: Select all

Cannot open input file 4519F2F!.
Errors: 1
OK: 0, not found: 1, read error: 0, wrong checksum: 0
Note that TC also supports that the filename and checksum are swapped. So in your case, the filename length is 8 and interpreted as the checksum and the code (with length 7) as the filename.

Both these things have to do with TC being flexible and not working with a strict format.
Infector
Junior Member
Junior Member
Posts: 47
Joined: 2005-11-22, 12:48 UTC
Location: Russia

Re: [TC11.51 RC2] Checksum verification

Post by *Infector »

Note that if checksums don't have the correct length, TC will not recognize them as such and treat the line as comment.
For me it looks a bit strange when TC haven't found a valid checksum and does not give an error or warning.
Maybe in that case TC should give an error? Something like "checksum missing"
User avatar
white
Power Member
Power Member
Posts: 5743
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC11.51 RC2] Checksum verification

Post by *white »

Infector wrote: 2025-01-25, 18:03 UTC Maybe in that case TC should give an error? Something like "checksum missing"
Answer from another thread:
ghisler(Author) wrote: 2024-12-10, 08:16 UTC Exactly, lines which do not contain a pair of checksum and file name will be ignored. There are checksum files with comments made by other tools, and I don't want to show errors for such lines.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50383
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC11.51 RC2] Checksum verification

Post by *ghisler(Author) »

Total Commander cannot recognize checksums with the wrong length. Trying to handle them would lead to a lot of problems, e.g. it would no longer be possible to decide whether a checksum is a full length MD5 or a shortened SHA1 with left out zeroes. All checksum tools I know always include leading zeroes.

Moderator message from: ghisler(Author) » 2025-01-26, 08:53 UTC

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
Post Reply