-
Notifications
You must be signed in to change notification settings - Fork 68
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
Added Singleton Object to load generated Data #8
Conversation
…e frequency lists and adjacency graphs so memory does not grow out of control on large passwords
@@ -629,6 +630,144 @@ - (NSString *)translate:(NSString *)string characterMap:(NSDictionary *)chrMap | |||
|
|||
@end | |||
|
|||
@implementation DBMatchResources |
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.
Is this section duplicate code? Or are you just changing the name of the object. I can't tell from GitHub.
I think a singleton for the matcher is a great idea! However, I think maybe the whole object could be a singleton instead. Want to try to make it more comprehensive? |
I added a new object to the file to handle to resource allocations |
I was going to do that first but wasn't sure if it would cause problems in other calls having the same object be modified by multiple calls |
Hmm... you're right. Adding the (ever changing) user inputs to the matchers would mess things up. I'd still like to not duplicate the methods used to generate the data. Maybe just have the omnimatch method in DBMatcher and everything else in DBMatchResources? |
ya I wasn't sure what methods I could safely take out from the existing code |
@jessemx109 want to take a stab at it? Or I can make the change if you prefer. Again, thanks for coming up with the idea. |
Ya I can take a look at it tonight |
👍 |
Ok finally got time to remove those duplicate methods. I took out three methods that are only used once and left the two that are used in other places |
I made a few small changes to the formatting to look more like the original zxcvbn, mostly just made everything lowercase 😝 |
Thanks for your help! 🎉 🏆 |
This adds the singleton object so memory doesn't grow to huge amounts. Look at what functions I moved into the new object so see if any are not needed in the standard DBMatcher Ojbect