mirror of
https://github.com/hyperoslo/Cache.git
synced 2026-04-07 19:17:36 +00:00
Remove all base64 methods
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user