]> granicus.if.org Git - python/commit
After a brief conversation and code review with TP, adding two very
authorBarry Warsaw <barry@python.org>
Tue, 15 Aug 2000 06:07:13 +0000 (06:07 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 15 Aug 2000 06:07:13 +0000 (06:07 +0000)
commite977c210cbadf5d4a91eefa94b9b10da484f6ef1
tree77d4b141b2ac807650dd6b6a5cdb9980066ac792
parent57b808d21a7651b303bf22264c4bc47824ab3b51
After a brief conversation and code review with TP, adding two very
commonly used functions to convert an arbitrary binary string into
a hexadecimal digit representation and back again.  These are often
(and often differently) implemented in Python.  Best to have one
common fast implementation.  Specifically,

binascii_hexlify(): a.k.a. b2a_hex() to return the hex representation
of binary data.

binascii_unhexlify(): a.k.a. a2b_hex() to do the inverse conversion
(hex digits to binary data).  The argument must have an even length,
and must contain only hex digits, otherwise a TypeError is raised.
Modules/binascii.c