refactor user_signup_session.py

This commit is contained in:
2024-07-17 11:51:48 -05:00
parent 802bd46d60
commit 310a86a5f9
6 changed files with 92 additions and 82 deletions

View File

@@ -27,5 +27,9 @@ def list_to_matrix(lst: list[int], cols: int) -> list[list[int]]:
return [lst[i:i + cols] for i in range(0, len(lst), cols)]
def matrix_transpose(interface: list[list[int]]) -> list[list[int]]:
return [list(row) for row in zip(*interface)]
def int_array_to_bytes(int_arr: list[int], byte_size: int = 2) -> bytes:
return b"".join([numb.to_bytes(byte_size, byteorder='big') for numb in int_arr])