import binascii


def hex_encode(string):
    """
    Hex encode a string

    Parameters
    ----------
    string : str
        String to be encoded
    Returns
    -------
    str
        Text string with hexadecimal representation of input string
    """
    return binascii.b2a_hex(string.encode()).decode()