import hashlib


def get_hash(data: bytes, hash_func=hashlib.sha256):
    """
    Hashing function used in key pairs.

    :param hash_func: function
    :param data: bytes
    :return: bytes
    """
    h = hash_func()
    h.update(data)
    return h.digest()