Browse Source

Adapt to new rules of Swift 1.2. thanks to markusl #26

Marcin Krzyżanowski 10 years ago
parent
commit
0f9a8ab82d

+ 1 - 1
CryptoSwift/HMAC.swift

@@ -29,7 +29,7 @@ public class HMAC {
         }
     }
     
-    let key:[UInt8]
+    var key:[UInt8]
     let variant:Variant
     
     class internal func authenticate(# key: NSData, message: NSData, variant:HMAC.Variant = .md5) -> NSData? {

+ 1 - 1
CryptoSwift/MD5.swift

@@ -112,7 +112,7 @@ class MD5 : CryptoSwift.HashBase {
             buf.appendBytes(&i, length: sizeofValue(i))
         })
         
-        return buf.copy() as NSData;
+        return buf.copy() as! NSData;
     }
 }
 

+ 1 - 1
CryptoSwift/SHA1.swift

@@ -97,6 +97,6 @@ class SHA1 : CryptoSwift.HashBase {
             buf.appendBytes(&i, length: sizeofValue(i))
         })
         
-        return buf.copy() as NSData;
+        return buf.copy() as! NSData;
     }    
 }

+ 2 - 2
CryptoSwift/SHA2.swift

@@ -155,7 +155,7 @@ class SHA2 : CryptoSwift.HashBase {
             buf.appendBytes(&i, length: sizeofValue(i))
         })
         
-        return buf.copy() as NSData;
+        return buf.copy() as! NSData;
     }
     
     func calculate64(variant: SHA2.variant) -> NSData {
@@ -239,6 +239,6 @@ class SHA2 : CryptoSwift.HashBase {
             buf.appendBytes(&i, length: sizeofValue(i))
         })
         
-        return buf.copy() as NSData;
+        return buf.copy() as! NSData;
     }
 }

+ 1 - 1
CryptoSwift/UInt32Extension.swift

@@ -14,7 +14,7 @@ extension UInt32 {
         return arrayOfBytes(self, length: totalBytes)
     }
 
-    public static func withBytes(bytes: Slice<Byte>) -> UInt32 {
+    public static func withBytes(bytes: Slice<UInt8>) -> UInt32 {
         return UInt32.withBytes(Array(bytes))
     }