Notifications
Clear all

File hash

4 Posts
4 Users
0 Likes
574 Views
mrpumba
(@mrpumba)
Posts: 116
Estimable Member
Topic starter
 

Does anyone have a good folder hash program? I need a program to check a file that has been back up'ed to our server from the local FRED. I am currently using MD5sum but that does each file hash instead of providing a hash for the entire folder. I want to be able to compare one hash instead of each files hash.

 
Posted : 29/04/2012 3:54 am
(@athulin)
Posts: 1156
Noble Member
 

Does anyone have a good folder hash program? I need a program to check a file that has been back up'ed to our server from the local FRED. I am currently using MD5sum but that does each file hash instead of providing a hash for the entire folder. I want to be able to compare one hash instead of each files hash.

A hash is computed on one single stream of bits. For a file, the bit stream is obviously the file data. But for a folder … ? What should it be? Part of it should probably be the separate files. But as order is extremely important … what order should be followed? By name? Time? Size? And what about metadata – should the file names be included (so that A\A.DAT should not compare equal to B\B.DAT, even if A.DAT is an exact copy of B.DAT?) (On Windows, you may need to take ADS into account …)

I don't know if there is anything like that. What about starting from md5sum, and then sort the output from each, and use either the full reports, or just the extracted sequence of hashes, and hash *those* for the final check.

If you're on a Unix platform, this should be easy to script. If you're on Windows, PowerShell or VB or your scripting language of choice should be your best bet.

 
Posted : 29/04/2012 12:06 pm
Beetle
(@beetle)
Posts: 318
Reputable Member
 

Check out md5summer. It flags the files that are different in directories.

 
Posted : 01/05/2012 8:14 pm
(@mscotgrove)
Posts: 938
Prominent Member
 

Why not just the hashes?

If the final result is correct, then both total hashes will be the same.

If incorrect, then at least you will have the hashes to see which is missing or mis matched.

The problem with this approach is that the hashes must be done in the same order.

Personally, I think it is safer to hash each file and compare the results. Any differences can then be tracked down, and the sequence of hashing is not important

 
Posted : 01/05/2012 9:33 pm
Share: