Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-91349: Expose the crc32 function from the lzma library#131721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Conversation
morotti commented Mar 25, 2025 • edited by github-actions bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by github-actions bot
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Misc/NEWS.d/next/Library/2025-03-18-14-18-06.gh-issue-91349.Qrnmxt.rst Outdated Show resolvedHide resolved
Uh oh!
There was an error while loading. Please reload this page.
1b298bd to ad43096Comparemorotti commented Apr 17, 2025
sorry for delay, all the docstring/comments were copy pasted from the zlib function. I guess the old function had an old style that is no longer wanted. for the return type in the docstring, we can settle with "positive integer" https://docs.python.org/3/library/zlib.html#zlib.crc32 |
AA-Turner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Misc/NEWS.d/next/Library/2025-03-18-14-18-06.gh-issue-91349.Qrnmxt.rst Outdated Show resolvedHide resolved
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
morotti commented Apr 17, 2025
@AA-Turner , I merged all your suggestions. for the versionadded: next, I thought changes on main would ship in 3.14? I am too late for 3.14 release? |
AA-Turner commented Apr 17, 2025
'next' is updated by the Release Manager for each version, it's a convenience tool that we use internally. We can still get this in for 3.14, yes. A |
morotti commented Apr 17, 2025
regarding performance, don't mind that for now, I will come back later. in principle
liblzma had code to start using hardware crc instructions soon ... and I see they just made a new stable release few days ago https://github.com/tukaani-project/xz/releases |
morotti commented Apr 17, 2025
it appears the |
AA-Turner commented Apr 17, 2025
I'll re-run it. |
morotti commented Apr 17, 2025
build passed, ready to merge |
AA-Turner commented Apr 18, 2025
Do you want to include your |
morotti commented Apr 18, 2025
Please don't mind the email. |
morotti commented May 12, 2025
ping, can this be merged? |
61094d8 to 0603528Comparemorotti commented Jun 25, 2025
@merwok@AA-Turner are you able to review? I've rebased on main and redid the chance, since it's been 3 months and main had changed. |
morotti commented Jun 27, 2025
@gpshead you've replied multiple times to my questions on improving compression code with "PR welcome". maybe you would be interested in reviewing this PR? |
Hello,
This is a simple PR to expose the crc32 function from the lzma library.
The code and tests are very similar to the crc in binascii and zlib. I don't think it's too controversial.
I came across this while looking at compression libraries for #91349
crc32 is always available from the lzma library (xz-utils/liblzma.so). I think it should be exposed.
there are more hashing functions available (namely crc64) but they need compilation/runtime checks to verify whether they are available.
Regards.
📚 Documentation preview 📚: https://cpython-previews--131721.org.readthedocs.build/