Selaa lähdekoodia

String.decrypt() does not make sense, therefore removed. It's highly unexpected that encrypted bytes can be easily treat as String, and that it can be decrypted.

Marcin Krzyżanowski 9 vuotta sitten
vanhempi
commit
a796561bd7
1 muutettua tiedostoa jossa 3 lisäystä ja 5 poistoa
  1. 3 5
      Sources/CryptoSwift/String+Extension.swift

+ 3 - 5
Sources/CryptoSwift/String+Extension.swift

@@ -45,11 +45,9 @@ extension String {
         return try self.utf8.lazy.map({ $0 as UInt8 }).encrypt(cipher: cipher)
     }
 
-    public func decrypt(cipher: Cipher) throws -> Array<UInt8> {
-        return try self.utf8.lazy.map({ $0 as UInt8 }).decrypt(cipher: cipher)
-    }
-    
-    /// Returns hex string of bytes.
+    // decrypt() does not make sense for String
+
+    /// Returns hex string of bytes
     public func authenticate(with authenticator: Authenticator) throws -> String {
         return try self.utf8.lazy.map({ $0 as UInt8 }).authenticate(with: authenticator).toHexString()
     }