Remove all base64 methods

This commit is contained in:
Khoa Pham
2017-06-02 11:30:39 +02:00
parent be792c137e
commit ea59a771c0
3 changed files with 1 additions and 31 deletions
@@ -29,19 +29,3 @@ extension String: Cachable {
return data(using: String.Encoding.utf8)
}
}
// MARK: - Helpers
/**
Helper String extension.
*/
extension String {
/**
Creates base64 string
- Returns: A base64 encoded string
*/
func base64() -> String {
guard let data = self.data(using: String.Encoding.utf8) else { return self }
return data.base64EncodedString(options: NSData.Base64EncodingOptions(rawValue: 0))
}
}
+1 -1
View File
@@ -304,7 +304,7 @@ public final class DiskStorage: StorageAware {
/**
Builds file name from the key.
- Parameter key: Unique key to identify the object in the cache
- Returns: A md5 or base64 string
- Returns: A md5 string
*/
func fileName(_ key: String) -> String {
return MD5(key)
@@ -7,20 +7,6 @@ class StringCacheSpec: QuickSpec {
override func spec() {
describe("String+Cache") {
describe("#base64") {
it("returns the correct base64 string") {
let items = [
"John Snow": "Sm9obiBTbm93",
"You know nothing": "WW91IGtub3cgbm90aGluZw==",
"Night's Watch": "TmlnaHQncyBXYXRjaA=="
]
for (key, value) in items {
expect(key.base64()).to(equal(value))
}
}
}
describe("Cachable") {
describe(".decode") {