Skip to content

Commit a205d0f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3cba478 commit a205d0f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎ciphers/base32.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ def base32_encode(data: bytes) -> bytes:
2323
if not data:
2424
return b""
2525
binary_data = "".join(bin(byte)[2:].zfill(8) for byte in data)
26-
remainder = len(binary_data) % 5
27-
if remainder != 0:
26+
if (remainder := len(binary_data) % 5) != 0:
2827
binary_data = binary_data + "0" * (5 - remainder)
2928
b32_chunks = [binary_data[i : i + 5] for i in range(0, len(binary_data), 5)]
3029
b32_result = "".join(B32_CHARSET[int(chunk, 2)] for chunk in b32_chunks)

0 commit comments

Comments
 (0)