Skip to content

MD5 hash not matching #99

@theFra985

Description

@theFra985

I've encountered weird behavior around MD5 hashes of post images.
On some images, the hash given by the API doesn't match the hash computed from the file downloaded from the CDN. (downloaded images open up correctly and match the preview)

e.g.
OP Post's image from thread 253748455 should have a packed MD5 of ujlTLUO2h564rwtTExF\/VA== obtained from the post entry returned by requesting https://a.4cdn.org/a/thread/253748455.json but instead, when downloading the actual image, the packed MD5 is AmVzMTHfH+fCv3RpwzccSg==.

I tried a few different ways of downloading the files and computing the MD5 because I thought my method of calculating it was the issue but all of them didn't match.

A quick example would be executing curl -v https://i.4cdn.org/a/1686810663343226.jpg | openssl dgst -md5 -binary | base64 and openssl dgst -md5 -binary FILENAME | base64. The two computed hashes match each other but they don't match the one given by the API.

Am I missing something? Is there more information included in the hashed data?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions