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

FEATURE : Provide overridable ShouldComputeHashes predicate method to prevent files from hashing. #2601

Merged
merged 2 commits into from
Dec 30, 2022

Conversation

shaopeng-gh
Copy link
Collaborator

This change only provides overridable for the derived class.

@@ -378,6 +378,11 @@ protected virtual bool ShouldEnqueue(string file, TContext context)
return shouldEnqueue;
}

protected virtual bool ShouldComputeHashes(string file, TContext context)
Copy link
Collaborator Author

@shaopeng-gh shaopeng-gh Dec 30, 2022

Choose a reason for hiding this comment

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

ShouldComputeHashes

This change enables override of ShouldComputeHashes instead of ShouldEnqueue

speed test of my local files folder with 7k files, roughly:

  1. previous PR using ShouldEnqueue: 00:03:47
  2. similar to before any change, directly return true: 00:02:48
  3. this PR and override with the check we desire(if is binary): 00:02:13

after this merged next will send PR for BinSkim using it.

*also tested using filter .exe
no benifit at all, both around 00:02:32

@michaelcfanning michaelcfanning merged commit 90f6a6d into main Dec 30, 2022
@michaelcfanning michaelcfanning deleted the users/shaopeng-gh/shouldhash branch December 30, 2022 16:28
This was referenced Feb 21, 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.

2 participants