-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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?
Conversation
Misc/NEWS.d/next/Library/2025-03-18-14-18-06.gh-issue-91349.Qrnmxt.rst
Outdated
Show resolved
Hide resolved
1b298bd
to
ad43096
Compare
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 |
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 resolved
Hide resolved
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
@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? |
'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 |
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 |
it appears the |
I'll re-run it. |
build passed, ready to merge |
Do you want to include your |
Please don't mind the email. |
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/