Made it more readable.

This commit is contained in:
The Wobbler 2024-11-19 18:04:01 +01:00
parent 64bb1fbf15
commit fdaad3a1f5

View file

@ -12,6 +12,11 @@ class Utils:
self.home_path = str(Path.home()) self.home_path = str(Path.home())
def bstring_to_oz(self, data): # convert binary data to a string of ones and zeros (oz) 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 return oz_string