Browse Source

Conforms to ExpressibleByArrayLiteral

Marcin Krzyżanowski 8 years ago
parent
commit
7183233c49
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Sources/CryptoSwift/SecureBytes.swift

+ 6 - 0
Sources/CryptoSwift/SecureBytes.swift

@@ -60,3 +60,9 @@ extension SecureBytes: Collection {
         return self.bytes.index(after: i)
     }
 }
+
+extension SecureBytes: ExpressibleByArrayLiteral {
+    public convenience init(arrayLiteral elements: UInt8...) {
+        self.init(bytes: elements)
+    }
+}