From: Barry Warsaw Date: Tue, 15 Aug 2000 06:08:00 +0000 (+0000) Subject: Describe the b2a_hex() and a2b_hex() functions (a.k.a. hexlify() and X-Git-Tag: v2.0b1~447 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0be4346da6250868f9c1788542e71cba062d2553;p=thirdparty%2FPython%2Fcpython.git Describe the b2a_hex() and a2b_hex() functions (a.k.a. hexlify() and unhexlify() respectively). --- diff --git a/Doc/lib/libbinascii.tex b/Doc/lib/libbinascii.tex index 8694ca94129e..7adb0e92d53b 100644 --- a/Doc/lib/libbinascii.tex +++ b/Doc/lib/libbinascii.tex @@ -84,6 +84,21 @@ crc. This is consistent with the ZIP file checksum. Use as follows: \end{verbatim} \end{funcdesc} +\begin{funcdesc}{b2a_hex}{data} +Return the hexadecimal representation of the binary \var{data}. Every +byte of \var{data} is converted into the corresponding 2-digit hex +representation. The resulting string is therefore, twice as long as +the length of \var{data}. This function is also available as +\function{hexlify()}. +\end{funcdesc} + +\begin{funcdesc}{a2b_hex}{hexstr} +Return the binary data represented by the hexadecimal string +\var{hexstr}. This function is the inverse of \function{b2a_hex()}. +\var{hexstr} must contain an even number of hexadecimal digits (which +can be upper or lower case), otherwise a \exception{TypeError} is +raised. This function is also available as \function{unhexlify()}. + \begin{excdesc}{Error} Exception raised on errors. These are usually programming errors. \end{excdesc}