Page 1 of 1

SHA1 checksums of mods

Posted: Sat Mar 21, 2020 8:04 pm
by Artentus
Not directly related to the game, if this belongs somewhere else please tell me.

I'm writing sofware that downloads mods from the mod portal.
Using the mod portal API to download mods, you are supplied a SHA1 checksum in the JSON response like this:

Code: Select all

	{
            ... ,
            "latest_release": {
                ... ,
                "sha1": "bbd86d46a4893c416f3f7775d6abb8698feb42e7"
            }
        }
However this checksum doesn't match the actual checksum of the downloaded mod file (checked multiple implementations and they all produced the same result, which was unequal to the provided hash).
I want to perform proper file integrity checks so I'd be thankful if someone told me how this is being calculated.
Thanks in advance!

Re: SHA1 checksums of mods

Posted: Sat Mar 21, 2020 8:17 pm
by boskid
Using SHA1 from 7zip it works as expected:
82633-sha1.png
82633-sha1.png (3.59 KiB) Viewed 1010 times

Re: SHA1 checksums of mods

Posted: Sat Mar 21, 2020 8:25 pm
by Artentus
Interesting. Thanks for your response.

When I download the file in my browser the checksum matches up. But if I download it in code it doesn't. Looks like the way I'm downloading somehow messes with the file.
I'll have to look into this. Consider it solved. Thanks!