how to decode hexadecimal in python 1

how to decode hexadecimal in python

hexstring = "4869"
a_string = bytes.fromhex(hexstring)
a_string = a_string.decode("ascii")
print(a_string)

Here is what the above code is Doing:
1. We take the hex string and convert it to a bytes object.
2. We then decode the bytes object to a string.

Similar Posts