Skip to content
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

Integrity#match bugfix and other optimizations #79

Merged
merged 4 commits into from
Apr 11, 2023
Merged

Conversation

wraithgar
Copy link
Member

@wraithgar wraithgar commented Apr 11, 2023

Closes #41

Built off of #76

Fixed up test coverage for that PR also

@wraithgar wraithgar requested a review from a team as a code owner April 11, 2023 18:13
@wraithgar wraithgar requested a review from fritzy April 11, 2023 18:13
@wraithgar
Copy link
Member Author

cc @H4ad

@@ -512,7 +563,7 @@ function createIntegrity (opts) {
}
}

const NODE_HASHES = new Set(crypto.getHashes())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sets are slower to instantiate and only faster on lookups when we get into the thousands of entries. On my machine this has 52 entries.

@wraithgar wraithgar requested review from nlf and removed request for fritzy April 11, 2023 18:24
@wraithgar wraithgar changed the title fix: Integrity#match prioritizes overlapping hashes Integrity#match prioritizes overlapping hashes Apr 11, 2023
@wraithgar wraithgar changed the title Integrity#match prioritizes overlapping hashes Integrity#match bugfix and other optimizations Apr 11, 2023
Copy link
Contributor

@nlf nlf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice cleanup and the fixes totally make sense

@wraithgar wraithgar merged commit 7fef846 into main Apr 11, 2023
@wraithgar wraithgar deleted the gar/common-match branch April 11, 2023 18:33
@github-actions github-actions bot mentioned this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Integrity#match doesn't always find common algorithm
3 participants