{"action":"closed","issue":{"url":"https://api.github.com/repos/krzyzanowskim/CryptoSwift/issues/310","repository_url":"https://api.github.com/repos/krzyzanowskim/CryptoSwift","labels_url":"https://api.github.com/repos/krzyzanowskim/CryptoSwift/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/krzyzanowskim/CryptoSwift/issues/310/comments","events_url":"https://api.github.com/repos/krzyzanowskim/CryptoSwift/issues/310/events","html_url":"https://github.com/krzyzanowskim/CryptoSwift/issues/310","id":172439066,"number":310,"title":"Hmac 256 giving a nil value","user":{"login":"ashiqsulaimanbaryons","id":20036490,"avatar_url":"https://avatars.githubusercontent.com/u/20036490?v=3","gravatar_id":"","url":"https://api.github.com/users/ashiqsulaimanbaryons","html_url":"https://github.com/ashiqsulaimanbaryons","followers_url":"https://api.github.com/users/ashiqsulaimanbaryons/followers","following_url":"https://api.github.com/users/ashiqsulaimanbaryons/following{/other_user}","gists_url":"https://api.github.com/users/ashiqsulaimanbaryons/gists{/gist_id}","starred_url":"https://api.github.com/users/ashiqsulaimanbaryons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashiqsulaimanbaryons/subscriptions","organizations_url":"https://api.github.com/users/ashiqsulaimanbaryons/orgs","repos_url":"https://api.github.com/users/ashiqsulaimanbaryons/repos","events_url":"https://api.github.com/users/ashiqsulaimanbaryons/events{/privacy}","received_events_url":"https://api.github.com/users/ashiqsulaimanbaryons/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-22T12:22:20Z","updated_at":"2016-08-22T12:34:17Z","closed_at":"2016-08-22T12:34:17Z","body":"When i try to generate a hmac with sha 256 i am getting a nil value, but its returning a string when i try it with online hmac generators\r\n\r\n```swift\r\nlet alertApi = “b2ba4aa080f3ccab5b7e5dd30a8da6bcOrFeckrWo\"\r\nlet array : [UInt8] = Array(alertApi.utf8)\r\n        let array2 : [UInt8] = Array(\"25\".utf8)\r\n  \r\n        let hmac: Array<UInt8> = try! Authenticator.HMAC(key: array2, variant: .sha256).authenticate(array)\r\n\r\n        //Convert [UInt8] to NSData\r\n        let data = NSData(bytes: hmac, length: hmac.count)\r\n        print(\"the data is \\(data)\")\r\n        //Convert NSData to NSString\r\n        let newNSString = NSString(data: data, encoding: NSUTF8StringEncoding)\r\n        \r\n        print(\"the string hmac is \\(newNSString)\")\r\n```"}}
{"actor":{"display_login":"krzyzanowskim"}}