The hash code of a file is not stored in the file. The file itself is used as the basis for calculating its hash code.
A hash code is generated by treating the file as a long sequence of 0's and 1's, running them through some form of hashing algorithm and thereby turning them into a more manageable (read: shorter) sequence of 0's and 1's. In that sense, the hash code is like a fingerprint of a human person. A small part of the human body is used to identify the whole person to a good degree of accuracy.
One of the most common hashing algorithms is called MD5. You can read on MD5 hashing
here.
Renaming a file does not change the hash code of a file. The file name is not part of the file contents and therefore isn't considered in the hashing process.
Hope this gets you headed in the right direction,
Stoepsel