This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure you add #import <CommonCrypto/CommonCrypto.h> to the Xcode bridging header | |
enum HMACAlgorithm { | |
case MD5, SHA1, SHA224, SHA256, SHA384, SHA512 | |
func toCCEnum() -> CCHmacAlgorithm { | |
var result: Int = 0 | |
switch self { | |
case .MD5: | |
result = kCCHmacAlgMD5 |