I converted base64 str1= eyJlbXBsb3llciI6IntcIm5hbWVcIjpcInVzZXJzX2VtcGxveWVyXCIsXCJhcmdzXCI6XCIxMDQ5NTgxNjI4MzdcIn0ifQ
to str2={"employer":"{\"name\":\"users_employer\",\"args\":\"104958162837\"}"}
with help of http://www.online-decoder.com/ru
I want to convert str2 to str1 with help of python. My code:
import base64
data = """{"employer":"{"name":"users_employer","args":"104958162837"}"}"""
encoded_bytes = base64.b64encode(data.encode("utf-8"))
encoded_str = str(encoded_bytes, "utf-8")
print(encoded_str)
The code prints str3=
eyJlbXBsb3llciI6InsibmFtZSI6InVzZXJzX2VtcGxveWVyIiwiYXJncyI6IjEwNDk1ODE2MjgzNyJ9In0=
What should I change in code to print str1 instead of str3 ?
I tried
{"employer":"{\"name\":\"users_employer\",\"args\":\"104958162837\"}"}
and
{"employer":"{"name":"users_employer","args":"104958162837"}"}
but result is the same