title: Sha 256 Encryption syntax error in swift 3.0
body: <pre><code>    func SHA256() -&gt; String {
  
      let data = self.data(using: String.Encoding.utf8)
      let res = NSMutableData(length: Int(CC_SHA256_DIGEST_LENGTH))
      CC_SHA256((data! as NSData).bytes, CC_LONG(data!.count), UnsafeMutablePointer(res!.mutableBytes))
      let hashedString = "\(res!)".replacingOccurrences(of: "", with: "").replacingOccurrences(of: " ", with: "")
      let badchar: CharacterSet = CharacterSet(charactersIn: "\"&lt;\",\"&gt;\"")
      let cleanedstring: String = (hashedString.components(separatedBy: badchar) as NSArray).componentsJoined(by: "")
      return cleanedstring
  
  }
  </code></pre>
  
  <p>I am using this function to encrypt strings it was working fine in swift 2, 
  now its not working in swift 3.0<a href="https://i.stack.imgur.com/Uo83L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uo83L.png" alt="enter image description here"></a> </p>