Browse Source

Optimize MD5 String By `reduce` Function

程鹏 6 years ago
parent
commit
7ea58dcc89
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Sources/Utility/String+MD5.swift

+ 1 - 1
Sources/Utility/String+MD5.swift

@@ -44,6 +44,6 @@ extension KingfisherWrapper where Base == String {
         }
         #endif
         
-        return digest.map { String(format: "%02x", $0) }.joined()
+        return digest.reduce(into: "") { $0 += String(format: "%02x", $1) }
     }
 }