From 327798ca4a93863c2d46968fcfc326cbfedd4b7a Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 15 Oct 2001 13:45:49 +0000 Subject: Added notes to clarify that binascii.crc32(), zlib.crc32(), and zlib.adler32() are not suitable as general hash functions. --- Doc/lib/libbinascii.tex | 4 +++- Doc/lib/libzlib.tex | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Doc/lib/libbinascii.tex b/Doc/lib/libbinascii.tex index 0ce0996..12c135e 100644 --- a/Doc/lib/libbinascii.tex +++ b/Doc/lib/libbinascii.tex @@ -92,7 +92,9 @@ Compute the binhex4 crc value of \var{data}, starting with an initial \begin{funcdesc}{crc32}{data\optional{, crc}} Compute CRC-32, the 32-bit checksum of data, starting with an initial -crc. This is consistent with the ZIP file checksum. Use as follows: +crc. This is consistent with the ZIP file checksum. Since the +algorithm is designed for use as a checksum algorithm, it is not +suitable for use as a general hash algorithm. Use as follows: \begin{verbatim} print binascii.crc32("hello world") # Or, in two pieces: diff --git a/Doc/lib/libzlib.tex b/Doc/lib/libzlib.tex index c78523b..e384b1f 100644 --- a/Doc/lib/libzlib.tex +++ b/Doc/lib/libzlib.tex @@ -29,7 +29,9 @@ The available exception and functions in this module are: used. This allows computing a running checksum over the concatenation of several input strings. The algorithm is not cryptographically strong, and should not be used for - authentication or digital signatures. + authentication or digital signatures. Since the algorithm is + designed for use as a checksum algorithm, it is not suitable for + use as a general hash algorithm. \end{funcdesc} \begin{funcdesc}{compress}{string\optional{, level}} @@ -58,7 +60,9 @@ The available exception and functions in this module are: checksum; otherwise, a fixed default value is used. This allows computing a running checksum over the concatenation of several input strings. The algorithm is not cryptographically strong, and - should not be used for authentication or digital signatures. + should not be used for authentication or digital signatures. Since + the algorithm is designed for use as a checksum algorithm, it is not + suitable for use as a general hash algorithm. \end{funcdesc} \begin{funcdesc}{decompress}{string\optional{, wbits\optional{, bufsize}}} -- cgit v0.12