In Swift 2, I used the following code to extend string variables and to be able to make sha1, sha256, and md5.
After moving to swift 3, the code is not working any more!
func MD5() -> String { let length = Int(CC_MD5_DIGEST_LENGTH) var digest = [UInt8](repeating: 0, count: length) if let d = self.data(using: String.Encoding.utf8) { d.withUnsafeBytes { (body: UnsafePointer) in CC_MD5(body, CC_LONG(d.count), &digest) } } return (0..