I want to convert normal text to \\x codes for e.g \\x14\\x65\\x60
For example :
normal text = \"base64_decode\" converted \\x codes for above text =
The ord() function gives you the decimal value for a single byte. dechex() converts it to hex. So to do this, loop through the every character in the string and apply both functions.
ord()
dechex()