Преглед на файлове

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 години
родител
ревизия
a796561bd7
променени са 1 файла, в които са добавени 3 реда и са изтрити 5 реда
  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()
     }