How are file diff ids calculated for github comparisons?

I was looking for a way to compute this directly for a script I’m writing. For file comparisons, github uses the format https://github.com/{user}/{repo}/compare/{base_ref}…{compare_ref}#diff-{file_diff_id}

The file diff id is 32 characters long, so I’m guessing it’s an md5 hash. Is there a way to generate this locally as opposed to authenticating with github, fetching the compare page, and scraping the source?

I have a script that generates summaries of branch differences. I’d like it to be able to create a url for each file that changed in the summary so users can view the changes on github.

1 Like

This is a duplicate of this previous topic:

You may want to continue the conversation there. Since this appears to be a duplicate, I’ll be closing this topic in about 24 hours.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.