Skip to content

Fix str type annotations to bytes #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions adafruit_binascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ def _transform(n: int) -> str:
assert len(TABLE_A2B_B64) == 256


def a2b_base64(b64_data: str) -> bytes:
def a2b_base64(b64_data: bytes) -> bytes:
"""Convert a block of base64 data back to binary and return the binary data.

:param str b64_data: Base64 data.
:param bytes b64_data: Base64 data.

"""
res = []
Expand Down Expand Up @@ -148,10 +148,10 @@ def a2b_base64(b64_data: str) -> bytes:
return b"".join(res)


def b2a_base64(bin_data: str) -> bytes:
def b2a_base64(bin_data: bytes) -> bytes:
"""Convert binary data to a line of ASCII characters in base64 coding.

:param str bin_data: Binary data string, as bytes
:param bytes bin_data: Binary data string, as bytes

"""
newlength = (len(bin_data) + 2) // 3
Expand Down