python hex to char code example
Example 1: python char to hex
tmp = "hello world"
print("".join(["{:02x}".format(ord(c)) for c in tmp]))
Example 2: hex to string python
>>> b'\xde\xad\xbe\xef'.hex()
'deadbeef'
Example 3: hex to string python
>>> bytes.fromhex('deadbeef')
b'\xde\xad\xbe\xef'