docs: def _calculate_file_hashes(full_path, f_hashers):
      """
      Returns a dictionary of (algorithm, hexdigest) values for the provided
      filename
      """
      if not os.path.exists(full_path):
          raise BagValidationError("%s does not exist" % full_path)
  
      try:
          with open(full_path, 'rb') as f:
              while True:
                  block = f.read(1048576)
                  if not block:
                      break
                  for i in list(f_hashers.values()):
                      i.update(block)
      except IOError as e:
          raise BagValidationError("could not read %s: %s" % (full_path, str(e)))
      except OSError as e:
          raise BagValidationError("could not read %s: %s" % (full_path, str(e)))
  
      return dict(
          (alg, h.hexdigest()) for alg, h in list(f_hashers.items())
      )