import hashlib


def same_files(file1, file2):
    """
    Compare files by calculating hash for each of them. Return True if hash is
    identical, False otherwise
    """
    with open(file1, 'rb') as fobj:
        hash1 = hashlib.sha256(fobj.read())

    with open(file2, 'rb') as fobj:
        hash2 = hashlib.sha256(fobj.read())

    return hash1.hexdigest() == hash2.hexdigest()