Skip to content

Commit 927e072

Browse files
committed
Merge pull request #6 from hyperoslo/feature/base64
Feature/base64
2 parents e468810 + 40f328f commit 927e072

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

Pod/Pod.xcodeproj/project.pbxproj

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
D520D4B21BBC47A2001A2A31 /* DiskCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D520D4B11BBC47A2001A2A31 /* DiskCache.swift */; settings = {ASSET_TAGS = (); }; };
1313
D520D4B61BBC4D0B001A2A31 /* CacheAware.swift in Sources */ = {isa = PBXBuildFile; fileRef = D520D4B51BBC4D0B001A2A31 /* CacheAware.swift */; settings = {ASSET_TAGS = (); }; };
1414
D520D4BB1BBEB59D001A2A31 /* Cachable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D520D4BA1BBEB59D001A2A31 /* Cachable.swift */; settings = {ASSET_TAGS = (); }; };
15+
D5704C531BC84DAA0089F388 /* String+Base64.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5704C521BC84DAA0089F388 /* String+Base64.swift */; settings = {ASSET_TAGS = (); }; };
1516
/* End PBXBuildFile section */
1617

1718
/* Begin PBXFileReference section */
@@ -23,11 +24,11 @@
2324
14C136521AB784B200B7B07A /* CONTRIBUTING.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = CONTRIBUTING.md; path = ../CONTRIBUTING.md; sourceTree = "<group>"; };
2425
14C136541AB784B200B7B07A /* LICENSE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = LICENSE.md; path = ../LICENSE.md; sourceTree = "<group>"; };
2526
14C136551AB784B200B7B07A /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
26-
14C1365C1AB784BC00B7B07A /* .gitkeep */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
2727
D520D4AF1BBC4770001A2A31 /* MemoryCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryCache.swift; sourceTree = "<group>"; };
2828
D520D4B11BBC47A2001A2A31 /* DiskCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiskCache.swift; sourceTree = "<group>"; };
2929
D520D4B51BBC4D0B001A2A31 /* CacheAware.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CacheAware.swift; sourceTree = "<group>"; };
3030
D520D4BA1BBEB59D001A2A31 /* Cachable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Cachable.swift; sourceTree = "<group>"; };
31+
D5704C521BC84DAA0089F388 /* String+Base64.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Base64.swift"; sourceTree = "<group>"; };
3132
/* End PBXFileReference section */
3233

3334
/* Begin PBXFrameworksBuildPhase section */
@@ -93,7 +94,7 @@
9394
14C1365B1AB784BC00B7B07A /* Source */ = {
9495
isa = PBXGroup;
9596
children = (
96-
14C1365C1AB784BC00B7B07A /* .gitkeep */,
97+
D5704C511BC84D990089F388 /* Extensions */,
9798
D520D4AF1BBC4770001A2A31 /* MemoryCache.swift */,
9899
D520D4B11BBC47A2001A2A31 /* DiskCache.swift */,
99100
D520D4B51BBC4D0B001A2A31 /* CacheAware.swift */,
@@ -103,6 +104,14 @@
103104
path = ../Source;
104105
sourceTree = "<group>";
105106
};
107+
D5704C511BC84D990089F388 /* Extensions */ = {
108+
isa = PBXGroup;
109+
children = (
110+
D5704C521BC84DAA0089F388 /* String+Base64.swift */,
111+
);
112+
path = Extensions;
113+
sourceTree = "<group>";
114+
};
106115
/* End PBXGroup section */
107116

108117
/* Begin PBXNativeTarget section */
@@ -172,6 +181,7 @@
172181
buildActionMask = 2147483647;
173182
files = (
174183
D520D4B01BBC4770001A2A31 /* MemoryCache.swift in Sources */,
184+
D5704C531BC84DAA0089F388 /* String+Base64.swift in Sources */,
175185
D520D4B21BBC47A2001A2A31 /* DiskCache.swift in Sources */,
176186
D520D4BB1BBEB59D001A2A31 /* Cachable.swift in Sources */,
177187
D520D4B61BBC4D0B001A2A31 /* CacheAware.swift in Sources */,

Source/.gitkeep

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Foundation
2+
3+
extension String {
4+
5+
func base64() -> String {
6+
guard let data = self.dataUsingEncoding(NSUTF8StringEncoding) else { return self }
7+
return data.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0))
8+
}
9+
}

0 commit comments

Comments
 (0)