binascii library
import binascii
text = 'Hello'
hexStr = binascii.hexlify(text.encode('utf-8')).decode('utf-8')
print(hexStr)
text = binascii.unhexlify(hexStr).decode('utf-8')
print(text)
import binascii
text = 'Hello'
hexStr = binascii.hexlify(text.encode('utf-8')).decode('utf-8')
print(hexStr)
text = binascii.unhexlify(hexStr).decode('utf-8')
print(text)
Leave a Comment
Cancel reply