From fdaad3a1f5886145399c0bbd8ba3d55077626183 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Tue, 19 Nov 2024 18:04:01 +0100 Subject: [PATCH] Made it more readable. --- utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 2ce17a7..7ff118f 100644 --- a/utils.py +++ b/utils.py @@ -12,6 +12,11 @@ class Utils: self.home_path = str(Path.home()) def bstring_to_oz(self, data): # convert binary data to a string of ones and zeros (oz) - oz_string = " ".join([format(byte, "08b") for byte in data]) + oz_bytes = [] + + for byte in data: + oz_bytes.append(format(byte, "08b")) + + oz_string = " ".join(oz_bytes) return oz_string