Skip to content

Commit

Permalink
Merge pull request #2117 from limeade/sha256
Browse files Browse the repository at this point in the history
Replace MD5 with SHA256
  • Loading branch information
onevcat authored Sep 10, 2023
2 parents 692a5b8 + 8a5f3dd commit 402fe7d
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 291 deletions.
8 changes: 4 additions & 4 deletions Kingfisher.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
07292245263B02F00089E810 /* KFAnimatedImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07292244263B02F00089E810 /* KFAnimatedImage.swift */; };
22FDCE0E2700078B0044D11E /* CPListItem+Kingfisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22FDCE0D2700078B0044D11E /* CPListItem+Kingfisher.swift */; };
3ADE9AF92A73CD69009A86CA /* String+SHA256.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ADE9AF82A73CD69009A86CA /* String+SHA256.swift */; };
4B10480D216F157000300C61 /* ImageDataProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B10480C216F157000300C61 /* ImageDataProcessor.swift */; };
4B46CC5F217449C600D90C4A /* MemoryStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B46CC5E217449C600D90C4A /* MemoryStorage.swift */; };
4B46CC64217449E000D90C4A /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B46CC63217449E000D90C4A /* Storage.swift */; };
Expand Down Expand Up @@ -52,7 +53,6 @@
D12AB718215D2BB50013BA68 /* CacheSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6B7215D2BB50013BA68 /* CacheSerializer.swift */; };
D12AB71C215D2BB50013BA68 /* FormatIndicatedCacheSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6B8215D2BB50013BA68 /* FormatIndicatedCacheSerializer.swift */; };
D12AB724215D2BB50013BA68 /* Box.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6BB215D2BB50013BA68 /* Box.swift */; };
D12AB728215D2BB50013BA68 /* String+MD5.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6BC215D2BB50013BA68 /* String+MD5.swift */; };
D12AB72C215D2BB50013BA68 /* Indicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6BE215D2BB50013BA68 /* Indicator.swift */; };
D12AB730215D2BB50013BA68 /* AnimatedImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12AB6BF215D2BB50013BA68 /* AnimatedImageView.swift */; };
D12E0C4F1C47F23500AC98AD /* dancing-banana.gif in Resources */ = {isa = PBXBuildFile; fileRef = D12E0C441C47F23500AC98AD /* dancing-banana.gif */; };
Expand Down Expand Up @@ -135,6 +135,7 @@
07292244263B02F00089E810 /* KFAnimatedImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KFAnimatedImage.swift; sourceTree = "<group>"; };
185218B51CC07F8300BD58DE /* NSButtonExtensionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSButtonExtensionTests.swift; sourceTree = "<group>"; };
22FDCE0D2700078B0044D11E /* CPListItem+Kingfisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CPListItem+Kingfisher.swift"; sourceTree = "<group>"; };
3ADE9AF82A73CD69009A86CA /* String+SHA256.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+SHA256.swift"; sourceTree = "<group>"; };
4B10480C216F157000300C61 /* ImageDataProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageDataProcessor.swift; sourceTree = "<group>"; };
4B164ACE1B8D554200768EC6 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
4B3E714D1B01FEB200F5AAED /* WatchKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WatchKit.framework; path = System/Library/Frameworks/WatchKit.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -182,7 +183,6 @@
D12AB6B7215D2BB50013BA68 /* CacheSerializer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CacheSerializer.swift; sourceTree = "<group>"; };
D12AB6B8215D2BB50013BA68 /* FormatIndicatedCacheSerializer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormatIndicatedCacheSerializer.swift; sourceTree = "<group>"; };
D12AB6BB215D2BB50013BA68 /* Box.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Box.swift; sourceTree = "<group>"; };
D12AB6BC215D2BB50013BA68 /* String+MD5.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+MD5.swift"; sourceTree = "<group>"; };
D12AB6BE215D2BB50013BA68 /* Indicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Indicator.swift; sourceTree = "<group>"; };
D12AB6BF215D2BB50013BA68 /* AnimatedImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimatedImageView.swift; sourceTree = "<group>"; };
D12E0C441C47F23500AC98AD /* dancing-banana.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "dancing-banana.gif"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -418,12 +418,12 @@
children = (
D13646732165A1A100A33652 /* Result.swift */,
D12AB6BB215D2BB50013BA68 /* Box.swift */,
D12AB6BC215D2BB50013BA68 /* String+MD5.swift */,
D1A37BE7215D365A009B39B7 /* ExtensionHelpers.swift */,
D1A37BF1215D3850009B39B7 /* SizeExtensions.swift */,
D1839844216E333E003927D3 /* Delegate.swift */,
4B8351CB217084660081EED8 /* Runtime.swift */,
D1BA781C2174D07800C69D7B /* CallbackQueue.swift */,
3ADE9AF82A73CD69009A86CA /* String+SHA256.swift */,
);
path = Utility;
sourceTree = "<group>";
Expand Down Expand Up @@ -811,7 +811,6 @@
D12AB6DC215D2BB50013BA68 /* ImageProcessor.swift in Sources */,
D12AB6D4215D2BB50013BA68 /* Image.swift in Sources */,
D1AEB09425890DE7008556DF /* ImageBinder.swift in Sources */,
D12AB728215D2BB50013BA68 /* String+MD5.swift in Sources */,
4B8E2917216F3F7F0095FAD1 /* ImageDownloaderDelegate.swift in Sources */,
D1132C9725919F69003E528D /* KFOptionsSetter.swift in Sources */,
D18B3222251852E100662F63 /* KF.swift in Sources */,
Expand Down Expand Up @@ -852,6 +851,7 @@
4BE688F822FD513700B11168 /* WKInterfaceImage+Kingfisher.swift in Sources */,
D12AB724215D2BB50013BA68 /* Box.swift in Sources */,
4B8E291C216F40AA0095FAD1 /* AuthenticationChallengeResponsable.swift in Sources */,
3ADE9AF92A73CD69009A86CA /* String+SHA256.swift in Sources */,
D12AB710215D2BB50013BA68 /* KingfisherOptionsInfo.swift in Sources */,
DCEB2842257E4BE100D7A610 /* TVMonogramView+Kingfisher.swift in Sources */,
);
Expand Down
2 changes: 1 addition & 1 deletion Sources/Cache/DiskStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public enum DiskStorage {

func cacheFileName(forKey key: String) -> String {
if config.usesHashedFileName {
let hashedKey = key.kf.md5
let hashedKey = key.kf.sha256
if let ext = config.pathExtension {
return "\(hashedKey).\(ext)"
} else if config.autoExtAfterHashedFileName,
Expand Down
278 changes: 0 additions & 278 deletions Sources/Utility/String+MD5.swift

This file was deleted.

Loading

0 comments on commit 402fe7d

Please sign in to comment.