decode_base64 491 B

12345678910111213141516171819
  1. import base64
  2. def convert_base64_string_to_object(base64_string):
  3. bytes = base64.b64decode(base64_string)
  4. string = bytes.decode("ascii")
  5. # return json.loads(string)
  6. return string
  7. if __name__ == "__main__":
  8. # Prompt the user for a base64 string
  9. user_input = input("Enter a base64 encoded string: ")
  10. # Call the function with the user's input
  11. result = convert_base64_string_to_object(user_input)
  12. # Print the result
  13. print("Decoded string:", result)