Before SDK8.3 I was generating my hmac this way. Now I get an error on the CCHmac() function. Since I'm a beginner I can't figure out how to fix it. Thanks in advance for your help!
xcode warning: cannot involke 'CCHmac' with an argument list of type (UInt32, [CChar]?, UInt, [CChar]?, UInt, inout[(CUnsignedChar)]
func generateHMAC(key: String, data: String) -> String {
let cKey = key.cStringUsingEncoding(NSUTF8StringEncoding)
let cData = data.cStringUsingEncoding(NSUTF8StringEncoding)
var result = [CUnsignedChar](count: Int(CC_SHA512_DIGEST_LENGTH), repeatedValue: 0)
CCHmac(CCHmacAlgorithm(kCCHmacAlgSHA512), cKey, strlen(cKey!), cData, strlen(cData!), &result)
let hash = NSMutableString()
for var i = 0; i < result.count; i++ {
hash.appendFormat("%02hhx", result[i])
}
return hash as String
}