.. function:: crc32(data[, value])
- Compute CRC-32, the 32-bit checksum of *data*, starting with an
+ Compute CRC-32, the unsigned 32-bit checksum of *data*, starting with an
initial CRC of *value*. The default initial CRC is zero. The algorithm
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
.. versionchanged:: 3.0
The result is always unsigned.
- To generate the same numeric value across all Python versions and
- platforms, use ``crc32(data) & 0xffffffff``.
-
+ To generate the same numeric value when using Python 2 or earlier,
+ use ``crc32(data) & 0xffffffff``.
.. function:: b2a_hex(data[, sep[, bytes_per_sep=1]])
hexlify(data[, sep[, bytes_per_sep=1]])
for use as a general hash algorithm.
.. versionchanged:: 3.0
- Always returns an unsigned value.
- To generate the same numeric value across all Python versions and
- platforms, use ``adler32(data) & 0xffffffff``.
-
+ The result is always unsigned.
+ To generate the same numeric value when using Python 2 or earlier,
+ use ``adler32(data) & 0xffffffff``.
.. function:: compress(data, /, level=-1)
for use as a general hash algorithm.
.. versionchanged:: 3.0
- Always returns an unsigned value.
- To generate the same numeric value across all Python versions and
- platforms, use ``crc32(data) & 0xffffffff``.
-
+ The result is always unsigned.
+ To generate the same numeric value when using Python 2 or earlier,
+ use ``crc32(data) & 0xffffffff``.
.. function:: decompress(data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)