import hashlib


def _hash_file(in_stream):
    """
    Hashes an already opened file
    """
    in_stream.seek(0)
    buf = in_stream.read()
    hasher = hashlib.sha256()
    hasher.update(buf)
    return hasher.hexdigest()