import hashlib


def sha256hash(buf):
    """Calculate a SHA256 hash

    :param buf: A bytes object containg the data to hash
    :returns: SHA256 hash digest as a hex string
    """
    return hashlib.sha256(buf.encode("utf-8")).hexdigest()