On this page
base64.decodebytes
Prev: base64.decode | Up: base64 | Next: base64.encode
Rel: base64.a85decode, base64.a85encode, base64.b16decode, base64.b16encode
Ref: docs.python.org — base64.decodebytes
Tags: #public #python3 #stdlib #base64
Import
import base64
from base64 import decodebytes
Signature & Overview
base64.decodebytes(s)
Decode a bytestring of base-64 data into a bytes object.
Usage
import base64
assert base64.decodebytes(b"aGVsbG8=\n") == b"hello"
Gotchas
- MIME-style decoder (ignores whitespace/newlines): Prefer
b64decode(..., validate=True)for strict API payloads.
REPL Inspect
from base64 import decodebytes
help(decodebytes)
Linked from
Related notes
- tuts/python3/stdlib_module/base64 Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/decode Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/encode Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/a85decode Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/a85encode Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/b16decode Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/b16encode Linked here; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib