]> granicus.if.org Git - python/commitdiff
Added notes to clarify that binascii.crc32(), zlib.crc32(), and
authorFred Drake <fdrake@acm.org>
Mon, 15 Oct 2001 13:45:49 +0000 (13:45 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 15 Oct 2001 13:45:49 +0000 (13:45 +0000)
zlib.adler32() are not suitable as general hash functions.

Doc/lib/libbinascii.tex
Doc/lib/libzlib.tex

index 0ce099680a2f0ec1b9373e0ea89efb5f96b71daf..12c135e36335f2bbf0ba9f7ed2e356e5a8476b92 100644 (file)
@@ -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:
index c78523b1ff02592bd103a44b772af6f39f40e05b..e384b1ff5bda9146ed03c4d7de638ace8c6d9534 100644 (file)
@@ -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}}}