On this page
base64.b16encode
Prev: base64.b16decode | Up: base64 | Next: base64.b32decode
Rel: base64.a85decode, base64.a85encode, base64.b16decode, base64.b32decode
Ref: docs.python.org — base64.b16encode
Tags: #public #python3 #stdlib #base64
Import
import base64
from base64 import b16encode
Signature & Overview
base64.b16encode(s)
Encode the bytes-like object s using Base16 and return a bytes object.
Usage
import base64
assert base64.b16encode(b"Hi") == b"4869"
Gotchas
- Uppercase ASCII
bytes: For lowercase hex strings,b"Hi".hex()is more concise.
REPL Inspect
from base64 import b16encode
help(b16encode)
Linked from
- tuts/python3/stdlib_module/base64
- tuts/python3/stdlib_module/base64/a85decode
- tuts/python3/stdlib_module/base64/a85encode
- tuts/python3/stdlib_module/base64/b16decode
- tuts/python3/stdlib_module/base64/b32decode
- tuts/python3/stdlib_module/base64/b32encode
- tuts/python3/stdlib_module/base64/b32hexdecode
- tuts/python3/stdlib_module/base64/b32hexencode
- tuts/python3/stdlib_module/base64/b64decode
- tuts/python3/stdlib_module/base64/b64encode
- tuts/python3/stdlib_module/base64/b85decode
- tuts/python3/stdlib_module/base64/b85encode
- tuts/python3/stdlib_module/base64/decode
- tuts/python3/stdlib_module/base64/decodebytes
- tuts/python3/stdlib_module/base64/encode
- tuts/python3/stdlib_module/base64/encodebytes
- tuts/python3/stdlib_module/base64/standard_b64decode
- tuts/python3/stdlib_module/base64/standard_b64encode
- tuts/python3/stdlib_module/base64/urlsafe_b64decode
- tuts/python3/stdlib_module/base64/urlsafe_b64encode
- tuts/python3/stdlib_module/base64/z85decode
- tuts/python3/stdlib_module/base64/z85encode
Related notes
- tuts/python3/stdlib_module/base64 Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/a85decode Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/a85encode Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/b16decode Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/b32decode Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/b32encode links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/b32hexdecode links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/b32hexencode links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/b64decode links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/base64/b64encode links to this page; shared tags: #stdlib