Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ import requests
|
|
11 |
|
12 |
def binary_array_to_hex(arr: np.ndarray) -> str:
|
13 |
"""Convert a binary array to a hex string."""
|
14 |
-
bit_string = ''.join(str(b) for b in arr.flatten())
|
15 |
width = int(np.ceil(len(bit_string) / 4))
|
16 |
return '{:0>{width}x}'.format(int(bit_string, 2), width=width)
|
17 |
|
|
|
11 |
|
12 |
def binary_array_to_hex(arr: np.ndarray) -> str:
|
13 |
"""Convert a binary array to a hex string."""
|
14 |
+
bit_string = ''.join(str(int(b)) for b in arr.flatten())
|
15 |
width = int(np.ceil(len(bit_string) / 4))
|
16 |
return '{:0>{width}x}'.format(int(bit_string, 2), width=width)
|
17 |
|