MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM
Re: Chdman questions
07/27/15 04:52 AM


> It boils down to this:
>
> I don't really understand where the sha1 value (that we find in UME softwarelist xml
> dats) comes from. For example, the pcecd game 'ys3' has an sha1 of:
>
> 2c9be3926d7cb5e5d46e5418be8fd0c01deb309f
>
> ... but that is not a) the hash of the chd itself, or b) the hash of the Trurip iso
> (which I think it is a clone of). Further - what is the hash of the cue file it would
> also contain?
>
> Understanding this would be a big help!
>
> Thanks again

The hash that appears in the .xml files is the sha1 hash of the compressed data in the .chd file, _not_ the whole .chd file. A .chd file consists of a header area and a data area. The two sha1 hashes that appear in the chdman "info" command are the "SHA1" and the "Data SHA1". It is the "SHA1" that corresponds to the hash listed in the .xml files. It is a hash of only the data portion of the .chd file.

If you wished, you could verify the "SHA1" by cutting off the header portion of the .chd file and running a conventional sha1 pass on that remaining data portion of the file - _or_ you could use the .chd file without cutting it, but start the sha1 computation at the beginning of the data portion of the .chd file.

The other sha1 hash, named "Data SHA1" by chdman, is the sha1 hash of the data before it was compressed. To re-compute that, you have to expand the .chd back to it's original .raw format, and then run the sha1 pass on that.

These two hashes are tabulated when the .chd file is created. The two hashes and some other things are placed in the header portion of the .chd file, and the compressed data from the original media occupies the data portion.

There is a third sha1 that can be produced - if you run the sha1 tabulation on the entire .chd file. This is the sha1 you will see when you have a dir2dat. The sha1 on the entire .chd file is different than the "SHA1" and "DataSHA1", of course.

None of these three sha1 hashes can be calculated from the other.

As for what sha1 hashes are correct for .iso, or .cue, who knows? Those sha1 hashes are not as clearly defined, because chdman has nothing to do with them. The sha1 hashes for .iso and .cue are only defined by the person who made those files. There isn't necessarily a standard to adhere to. There may be a standard practice, which might be good enough. But the different sha1 hashes are not related to one another. The only way to compare one to another is through a "rosetta stone" - that is, a list that someone has compiled. There is no computational way of converting one sha1 hash to another - short of obtaining the .chd and hashing it.







Entire thread
Subject Posted by Posted on
* Chdman questions midget35 07/26/15 12:58 PM
. * Re: Chdman questions mw  07/26/15 06:25 PM
. * Re: Chdman questions midget35  07/26/15 07:27 PM
. * Re: Chdman questions R. Belmont  07/27/15 04:42 PM
. * Re: Chdman questions mw  07/27/15 04:52 AM
. * Re: Chdman questions CiroConsentino  07/26/15 07:44 PM
. * Re: Chdman questions midget35  07/26/15 09:24 PM
. * Re: Chdman questions CiroConsentino  07/26/15 11:37 PM
. * Re: Chdman questions midget35  07/27/15 05:13 PM
. * Re: Chdman questions R. Belmont  07/27/15 05:20 PM
. * Re: Chdman questions midget35  07/27/15 05:49 PM
. * Re: Chdman questions mw  07/27/15 08:40 PM
. * Re: Chdman questions midget35  07/28/15 08:32 PM
. * Re: Chdman questions mw  07/29/15 08:40 AM
. * Re: Chdman questions midget35  07/29/15 10:06 AM
. * Re: Chdman questions Haze  07/27/15 06:07 PM
. * Re: Chdman questions midget35  07/27/15 06:26 PM
. * Re: Chdman questions Haze  07/27/15 06:57 PM
. * Re: Chdman questions midget35  07/27/15 07:59 PM
. * Re: Chdman questions R. Belmont  07/27/15 08:20 PM
. * Re: Chdman questions midget35  07/27/15 08:55 PM
. * Re: Chdman questions R. Belmont  07/27/15 09:48 PM
. * Re: Chdman questions midget35  07/27/15 11:22 PM
. * Re: Chdman questions Moose  07/28/15 02:17 AM

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 243 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 3469