def str2hex(s):
    res = ["'"]
    for c in s:
        res.append("\\x%02x" % ord(c))
    res.append("'")
    return "".join(res)
Convert string to hex-encoded string.
dataset/ETHPy150Open kdart/pycopia/aid/pycopia/aid.py/str2hex