<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hashfile(name: str) -> str: """ Gets a hash of a file using block parsing http://stackoverflow.com/questions/3431825/generating-a-md5-checksum-of-a-file Using SHA512 for long-term support (hehehehe) """

        hasher = hashlib.sha512()
        with open(name, 'rb') as openfile:
            for chunk in iter(lambda: openfile.read(4096), b''):
                hasher.update(chunk)
        return hasher.hexdigest()