import binascii


def hexlify(data):
    """The binascii.hexlify function returns a bytestring in
       Python3, but sometimes we want to use its output to
       show a log message. This function returns an unicode
       str, which is suitable for it."""
    return binascii.hexlify(data).decode('ascii')