How to get a diff on binary file in GitHub?

Hi, I am trying to get a diff on a binary file using the GitHub api.

curl -u user:token -H “Accept: application/vnd.github.diff” https://api.github.com/repos/user/repo/commits/hash

new file mode 100644
index 0000000…87b738c
Binary files /dev/null and b/test.jar differ

Once I do that I want to take the diff in the file below on my local copy of the repo, in this case 87b738c, and use it to get the long hash of the file using
git rev-parse 87b738c

But for some reason the hash in the local repo is f3d88b1 instead of 87b738c

Is there a different way to get the diff from GitHub or locally for binary files?
Thanks