The filesha256 function computes the SHA256 hash of the contents of a given file and encodes it as hex.