base64.standard_b64encode
Prev: base64.standard_b64decode | Up: base64 | Next: base64.urlsafe_b64decode
Rel: base64.a85decode, base64.a85encode, base64.b16decode, base64.b16encode
Ref: docs.python.org — base64.standard_b64encode
Tags: #public #python3 #stdlib #base64
Import
import base64
from base64 import standard_b64encode
Signature & Overview
base64.standard_b64encode(s)
Encode bytes-like object s using the standard Base64 alphabet.
Usage
import base64
assert base64.standard_b64encode(b"hello") == b"aGVsbG8="
Gotchas
- Equivalent to
b64encode(s): Useurlsafe_b64encode()for URLs, JWTs, and filenames.
REPL Inspect
from base64 import standard_b64encode
help(standard_b64encode)
Linked from
Related notes
- tuts/python3/stdlib_module/base64 Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/standard_b64decode Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/urlsafe_b64decode 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