Skip to content

Commit c8a96c8

Browse files
committed
update docs
1 parent f71608e commit c8a96c8

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

Doc/library/zlib.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ The available exception and functions in this module are:
4444
.. versionchanged:: 3.0
4545
The result is always unsigned.
4646

47+
.. function:: adler32_combine(adler1, adler2, len2, /)
48+
49+
Combine two Adler-32 checksums into one.
50+
51+
Given an Adler-32 check value *adler1* of a sequence A and an Adler-32 check
52+
value *adler2* of a sequence B of length *len2*, the returned checksum
53+
is the Adler-32 check value of A and B concatenated.
54+
55+
.. versionadded:: next
56+
4757
.. function:: compress(data, /, level=-1, wbits=MAX_WBITS)
4858

4959
Compresses the bytes in *data*, returning a bytes object containing compressed data.
@@ -136,6 +146,16 @@ The available exception and functions in this module are:
136146
.. versionchanged:: 3.0
137147
The result is always unsigned.
138148

149+
.. function:: crc32_combine(crc1, crc2, len2, /)
150+
151+
Combine two CRC-32 checksums into one.
152+
153+
Given a CRC-32 check value *crc1* of a sequence A and a CRC-32 check
154+
value *crc2* of a sequence B of length *len2*, the returned checksum
155+
is the CRC-32 check value of A and B concatenated.
156+
157+
.. versionadded:: next
158+
139159
.. function:: decompress(data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)
140160

141161
Decompresses the bytes in *data*, returning a bytes object containing the

Doc/whatsnew/3.15.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ ssl
9797
(Contributed by Will Childs-Klein in :gh:`133624`.)
9898

9999

100+
zlib
101+
----
102+
103+
* Allow to combine two Adler-32 checksums via :func:`~zlib.adler32_combine`.
104+
(Contributed by Callum Attryde and Bénédikt Tran in :gh:`134635`.)
105+
106+
* Allow to combine two CRC-32 checksums via :func:`~zlib.crc32_combine`.
107+
(Contributed by Bénédikt Tran in :gh:`134635`.)
108+
109+
100110
.. Add improved modules above alphabetically, not here at the end.
101111
102112
Optimizations
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:mod:`zlib`: Allow to combine Adler-32 and CRC-32 checksums via
2+
:func:`~zlib.adler32_combine` and :func:`~zlib.crc32_combine`. Patch by
3+
Callum Attryde and Bénédikt Tran.

0 commit comments

Comments
 (0)