aboutsummaryrefslogtreecommitdiff
path: root/benchmark/reports/json_to_base_64.py
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/reports/json_to_base_64.py')
-rw-r--r--benchmark/reports/json_to_base_64.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/benchmark/reports/json_to_base_64.py b/benchmark/reports/json_to_base_64.py
new file mode 100644
index 000000000..42cbc4df8
--- /dev/null
+++ b/benchmark/reports/json_to_base_64.py
@@ -0,0 +1,17 @@
+import base64
+import json
+
+# Load JSON data from a file
+with open("secrets.json", "r") as f:
+ data = json.load(f)
+
+# Convert the JSON object into a string
+json_string = json.dumps(data)
+
+# Encode the string into bytes
+json_bytes = json_string.encode("utf-8")
+
+# Convert the bytes to a base64 string
+base64_string = base64.b64encode(json_bytes).decode("utf-8")
+
+print(base64_string)