def hexify(s):
    """
    Used to convert message to hex integers when encrypting.

    :param s: a string.
    :return: a string like '0x..', decode each character as a ascii hex number.
    """
    if not s:  # if input is null, evcrypt the message: '!'
        return '0x21'  # ascii code for '!'
    lst = []
    for ch in s:
        hv = hex(ord(ch)).replace('0x', '')
        lst.append(hv)
    return '0x' + ''.join(lst)