Switched hash for an implementation of MD5 cache to great unique URL keys #14
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into a problem where the
inline static NSString* keyForURL(NSURL* url, NSString* style)method was not returning a unique URL key for my images.I noticed it when 3 different images with different URLs in one app all produced the same URL key using
hashtherefore the wrong image was loaded from the cache.I have added an NSString category (NSString+MD5) with a single method,
- (NSString *)md5Hash;that returns a MD5 hash of a string. I have swapped the origin use forhashin EGOImageLoader.m for this new method.I've done some testing and it seems to have solved my problem.
I haven't included any credit in the header of the NSString category as I found it on Stack Overflow where no credit was given.