GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Export `zlib.{adler,crc}32_combine` · Issue #134635 · python/cpython

Export zlib.{adler,crc}32_combine #134635

New issue
Copy link
New issue
Copy link
Closed
Closed
Export zlib.{adler,crc}32_combine#134635
Copy link
Assignees
picnixz
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement

Description

@thatch
thatch
opened on May 24, 2025
Issue body actions

Feature or enhancement

Proposal:

This is already provided by zlib, and is useful for computing a crc32 in multiple chunks (not linearly).

What I currently do is use ctypes, but that doesn't work on all environments (like Windows). I don't think we'll need a pure python fallback, just a wrapper of what's in zlib, equivalent of https://github.com/fastzip/fastzip/blob/9019107a6732fab9004e625b075faab96f29265a/fastzip/_crc32_combine.py#L63-L67

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

  • gh-134635: add zlib.{adler32,crc32}_combine to combine checksums #134650

Activity

  1. thatch
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on May 24, 2025
  2. picnixz
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on May 24, 2025
  3. picnixz commented on May 24, 2025

    @picnixz
    picnixz
    on May 24, 2025
    Member
    More actions

    cc @emmatyping (or is zstd not supporting this one? I don't know if you now want to take care of compression issues as well in general)

  4. picnixz
    added this to Compression issues 🗜on May 24, 2025
  5. emmatyping commented on May 24, 2025

    @emmatyping
    emmatyping
    on May 24, 2025
    Member
    More actions

    @picnixz this is zlib related, not zstandard, but I am hoping to take care of more compression issues going forward!

  6. emmatyping commented on May 24, 2025

    @emmatyping
    emmatyping
    on May 24, 2025
    Member
    More actions

    I think this request is reasonable, we probably would want to also add adler32_combine for completeness/symmetry.

    I don't think we should add crc32_combine_gen/crc32_combine_op without additional motivation.

  7. picnixz commented on May 24, 2025

    @picnixz
    picnixz
    on May 24, 2025
    Member
    More actions

    this is zlib related

    Yeah, I actually misread the issue first :')

    I am hoping to take care of more compression issues going forward!

    Great to hear!

    adler32_combine

    Yes, sure. Note that we could also think about whether to add binascii.crc32_combine as well (we have a minimal support for CRC32 even without zlib in binascii but I don't know if it would also make sense to expose crc32_combine in this case). I wouldn't recommend it as a first iteration (and we anyway don't have binascii.adler32)

    Reacted by Emma Smith
  8. emmatyping commented on May 24, 2025

    @emmatyping
    emmatyping
    on May 24, 2025
    Member
    More actions

    I should note that if one is merely iterating over chunks of data, using the value argument to zlib.crc32 (i.e. setting an initial checksum) should work to compute a running checksum.

    However, looking at the fastzip code, they are concurrently calculating the checksums and assembling them afterwards, so they cannot chain calls to zlib.crc32.

  9. picnixz
    self-assigned this
    on May 25, 2025
  10. picnixz commented on May 25, 2025

    @picnixz
    picnixz
    on May 25, 2025
    Member
    More actions

    Actually, there was #82868 and #17048 for adler32_combine but it was not tested. I'll close the older issue and will add both as part of this specific issue.

  11. picnixz
    marked Expose 'adler32_combine' function from zlib #82868 as a duplicate of this issue on May 25, 2025
  12. picnixz
    changed the title [-]Expose crc32_combine from zlib[/-] [+]Export `zlib.{adler,crc}32_combine`[/+] on May 25, 2025
  13. picnixz
    added a commit that references this issue on May 27, 2025

    gh-134635: add `zlib.{adler32,crc32}_combine` to combine checksums (#…

    737b4ba
  14. picnixz
    closed this as completedon May 27, 2025
  15. github-project-automation
    moved this to Done in Compression issues 🗜on May 27, 2025
  16. Pranjal095
    added a commit that references this issue on Jul 12, 2025

    pythongh-134635: add `zlib.{adler32,crc32}_combine` to combine checks…

    67904d6
  17. taegyunkim
    added a commit that references this issue on Aug 4, 2025

    pythongh-134635: add `zlib.{adler32,crc32}_combine` to combine checks…

    4b8b054
  18. gostak-dd
    added a commit that references this issue on Jun 2, 2026

    pythongh-134635: add `zlib.{adler32,crc32}_combine` to combine checks…

    68324f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @picnixz
    picnixz

Labels

extension-modulesC modules in the Modules dirC modules in the Modules dirtype-featureA feature request or enhancementA feature request or enhancement

Projects

  • Compression issues 🗜
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.