Procházet zdrojové kódy

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 před 9 roky
rodič
revize
a796561bd7
1 změnil soubory, kde provedl 3 přidání a 5 odebrání
  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()
     }