Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
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
bpo-29410: Change the default hash algorithm to SipHash13. #28752
bpo-29410: Change the default hash algorithm to SipHash13. #28752
Changes from all commits
de12ceb
196d5a6
b121503
381253b
9963135
add336e
b8c6f69
b83e3f0
ac6e8ec
5e7a4ad
5d2e6f2
69c9d12
0dce1e7
23d06e1
2de4af1
cfa0060
a096bca
86cf6c6
File filter
Conversations
Jump to
There are no files selected for viewing
methaneOct 8, 2021
Author
Member
Created by this code. https://gist.github.com/methane/5bb59a0563a025994e49fac509b49bf9
tiranOct 8, 2021
Member
I'm not sure that it's a good idea to change the keyed hash format. PEP 552 kinda implies that PYC format uses SipHash-2-4. This change breaks backwards compatibility of public API
importlib.util.source_hash
. The output ofsource_hash()
on 3.11 would no longer be compatible with Python 3.10 and older releases.@benjaminp @brettcannon What do you think?
methaneOct 8, 2021
Author
Member
If "breaks backward compatibility" means changing hash value, incrementing MAGIC number is also backward incompatible.
I changed this hash function because speeding up hash validation may increase startup time when hash validation is used.
tiranOct 8, 2021
Member
Good point!
May I suggest that we either wait for feedback from Brett and Benjamin or move the change into a separate BPO? This change may need an update of PEP 552, too.
benjaminpOct 8, 2021
Contributor
No application I'm aware of would care about this changing.
importlib.util.source_hash
just exists to have the same result as what the importlib system would compute.tiranOct 9, 2021
Member
Thanks for the feedback, Benjamin!