code: def hash(cls, path, digest=None, hasher=sha1):
      
      if digest is None:
        digest = hasher()
      with open(path, 'rb') as fh:
        cls.update_hash(fh, digest)
      return digest.hexdigest()
docs: Return the digest of a single file in a memory-efficient manner.