How to build a link to a file in a Pull Request

A while back, if you wanted to make a link to a certain file in a pull request, you could use the url: https://github.com///pull//files#diff-

However, that changed to where the fileNumber is now some sort of hash, or a just a string of characters. Where does that string of characters come from? Is it possible to query for that string using the rest api? Ideally I could get that url from the api, but based off of this discussion(How to build direct link to a file change in a PR), it is not exposed in v3 or v4.

So, long story short, is there a way to create the url to a certain file in a pull request?

Thank you in advance for your help.

It turns out that in my original description, when I put the greater and less than signs, the text between them is hidden. I tried to edit my original post to fix that, but am unable to…
I did find the answer to my problem. The has at the end of the diff url is a sha256 hash of the file path.