From 3e0e5b31d1dfb96fdbb6092f0e4e6e4eff80acf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=BCller?= Date: Wed, 27 Dec 2023 12:03:59 +0100 Subject: [PATCH] encrypt_slack_nicks.py: make more robust if there are numbers only --- encrypt_slack_nicks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/encrypt_slack_nicks.py b/encrypt_slack_nicks.py index 64d703b..900038b 100644 --- a/encrypt_slack_nicks.py +++ b/encrypt_slack_nicks.py @@ -23,7 +23,7 @@ def encrypt_values(data, key): encrypted_data = {} for k, v in data.items(): - encrypted_value = cipher_suite.encrypt(v.encode()).decode('utf-8') + encrypted_value = cipher_suite.encrypt(f"{v}".encode()).decode('utf-8') encrypted_data[k] = encrypted_value return encrypted_data @@ -33,7 +33,7 @@ def decrypt_values(data, key): decrypted_data = {} for k, v in data.items(): - decrypted_value = cipher_suite.decrypt(v.encode()).decode('utf-8') + decrypted_value = cipher_suite.decrypt(f"{v}".encode()).decode('utf-8') decrypted_data[k] = decrypted_value return decrypted_data