diff options
author | Barry Warsaw <barry@python.org> | 2000-08-15 06:08:00 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2000-08-15 06:08:00 (GMT) |
commit | 0be4346da6250868f9c1788542e71cba062d2553 (patch) | |
tree | 68eabe3f40f2a0044beda1c6d58c9b66862ef1a5 /Doc/lib | |
parent | e977c210cbadf5d4a91eefa94b9b10da484f6ef1 (diff) | |
download | cpython-0be4346da6250868f9c1788542e71cba062d2553.zip cpython-0be4346da6250868f9c1788542e71cba062d2553.tar.gz cpython-0be4346da6250868f9c1788542e71cba062d2553.tar.bz2 |
Describe the b2a_hex() and a2b_hex() functions (a.k.a. hexlify() and
unhexlify() respectively).
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/libbinascii.tex | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/lib/libbinascii.tex b/Doc/lib/libbinascii.tex index 8694ca9..7adb0e9 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} |