On this page
binascii.a2b_hex
Prev: binascii.a2b_base64 | Up: binascii | Next: binascii.a2b_qp
Rel: binascii.a2b_base64, binascii.a2b_qp, binascii.a2b_uu, binascii.b2a_base64
Ref: docs.python.org — binascii.a2b_hex
Tags: #public #python3 #stdlib #binascii
Import
import binascii
from binascii import a2b_hex
Signature & Overview
binascii.a2b_hex(hexstr, /)
Binary data of hexadecimal representation.
Usage
import binascii
assert binascii.a2b_hex(b"4869") == b"Hi"
Gotchas
- Alias for
unhexlify(): Requires an even number of hex digits;bytes.fromhex()also ignores whitespace.
REPL Inspect
from binascii import a2b_hex
help(a2b_hex)
Linked from
- tuts/python3/stdlib_module/binascii
- tuts/python3/stdlib_module/binascii/a2b_base64
- tuts/python3/stdlib_module/binascii/a2b_qp
- tuts/python3/stdlib_module/binascii/a2b_uu
- tuts/python3/stdlib_module/binascii/b2a_base64
- tuts/python3/stdlib_module/binascii/b2a_hex
- tuts/python3/stdlib_module/binascii/b2a_qp
- tuts/python3/stdlib_module/binascii/b2a_uu
- tuts/python3/stdlib_module/binascii/crc32
- tuts/python3/stdlib_module/binascii/crc_hqx
- tuts/python3/stdlib_module/binascii/Error
- tuts/python3/stdlib_module/binascii/hexlify
- tuts/python3/stdlib_module/binascii/Incomplete
- tuts/python3/stdlib_module/binascii/unhexlify
Related notes
- tuts/python3/stdlib_module/binascii/a2b_base64 Linked here; links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/a2b_qp Linked here; links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/a2b_uu Linked here; links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/b2a_base64 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/b2a_hex links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/b2a_qp links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/b2a_uu links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/crc32 links to this page; shared tags: #binascii, #stdlib
- tuts/python3/stdlib_module/binascii/crc_hqx links to this page; shared tags: #binascii, #stdlib