import hashlib


def hash_SHA256_twice(by):
    """
    Use hashlib to hash with SHA256 twice, expects binary input
    """
    h1 = hashlib.sha256(by).digest()
    h2 = hashlib.sha256(h1).digest()

    return h2