"""Streaming hashes for platform package files.""" import hashlib def file_sha256(path): with path.open('rb') as stream: return hashlib.file_digest(stream, 'sha256').hexdigest()