code: def get_hash_for_filename(filename, hashfile_path):
      
      filehash = ''
      with open(hashfile_path, 'r') as stream:
          for _cnt, line in enumerate(stream):
              if line.rstrip().endswith(filename):
                  filehash = re.match(r'^[A-Za-z0-9]*', line).group(0)
                  break
      if filehash:
          return filehash
      raise AttributeError("Filename %s not found in hash file" % filename)
docs: Return hash for filename in the hashfile.