def hash_file(filename):
sha256 = hashlib.sha256()<EOL>with open(filename, '<STR_LIT:rb>') as f:<EOL><INDENT>for chunk in iter(lambda: f.read(<NUM_LIT>), b'<STR_LIT>'):<EOL><INDENT>sha256.update(chunk)<EOL><DEDENT><DEDENT>return '<STR_LIT>' + sha256.hexdigest()<EOL>
Hash a file using the same method the registry uses (currently SHA-256).

:param filename: Name of file to hash
:type filename: str

:rtype: str
:returns: Hex-encoded hash of file's content (prefixed by ``sha256:``)