@@ -114,7 +114,7 @@ func rotateLeft(value: UInt32, bits: UInt32) -> UInt32 {
return ((value << bits) & 0xFFFFFFFF) | (value >> (32 - bits))
}
-class MD5 : HashBase {
+class MD5: HashBase {
/** specifies the per-round shift amounts */
private let shifts: [UInt32] = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
@@ -212,10 +212,10 @@ class MD5 : HashBase {
let buf: NSMutableData = NSMutableData()
hh.forEach({ (item) -> () in
- var i:UInt32 = item.littleEndian
+ var i: UInt32 = item.littleEndian
buf.appendBytes(&i, length: sizeofValue(i))
})
- return buf.copy() as! NSData
+ return NSData(data: buf)
@@ -78,7 +78,7 @@ extension UIImage {
let contextHolder = UnsafeMutablePointer<Void>()
let context = CGBitmapContextCreate(contextHolder, CGImageGetWidth(imageRef), CGImageGetHeight(imageRef), 8, 0, colorSpace, bitmapInfo)
if let context = context {
- let rect = CGRectMake(0, 0, CGFloat(CGImageGetWidth(imageRef)), CGFloat(CGImageGetHeight(imageRef)))
+ let rect = CGRect(x: 0, y: 0, width: CGImageGetWidth(imageRef), height: CGImageGetHeight(imageRef))
CGContextDrawImage(context, rect, imageRef)
let decompressedImageRef = CGBitmapContextCreateImage(context)
return UIImage(CGImage: decompressedImageRef!, scale: scale, orientation: self.imageOrientation)
@@ -299,7 +299,7 @@ public extension UIImageView {
let indicatorStyle = UIActivityIndicatorViewStyle.Gray
#endif
let indicator = UIActivityIndicatorView(activityIndicatorStyle:indicatorStyle)
- indicator.center = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds))
+ indicator.center = CGPoint(x: CGRectGetMidX(bounds), y: CGRectGetMidY(bounds))
indicator.autoresizingMask = [.FlexibleLeftMargin, .FlexibleRightMargin, .FlexibleBottomMargin, .FlexibleTopMargin]
indicator.hidden = true