Parcourir la source

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 il y a 9 ans
Parent
commit
a796561bd7
1 fichiers modifiés avec 3 ajouts et 5 suppressions
  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()
     }