Skip to content

Instantly share code, notes, and snippets.

// 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