On this page
binascii.hexlify
Prev: binascii.Error | Up: binascii | Next: binascii.Incomplete
Rel: binascii.a2b_base64, binascii.a2b_hex, binascii.a2b_qp, binascii.a2b_uu
Ref: docs.python.org — binascii.hexlify
Tags: #public #python3 #stdlib #binascii
Import
import binascii
from binascii import hexlify
Signature & Overview
binascii.hexlify(...)
Hexadecimal representation of binary data.
Usage
import binascii
assert binascii.hexlify(b"\xde\xad\xbe\xef") == b"deadbeef"
Gotchas
- Returns lowercase ASCII
bytes: For astr,data.hex()is built intobytesand needs no import.
REPL Inspect
from binascii import hexlify
help(hexlify)
Linked from
Related notes
- tuts/python3/stdlib_module/binascii/Error Linked here; links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/Incomplete Linked here; links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/binascii/a2b_base64 Linked here; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/a2b_hex Linked here; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/a2b_qp Linked here; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/a2b_uu Linked here; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/b2a_base64 shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/b2a_hex shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/b2a_qp shared tags: #binascii, #stdlib