functoCCHmacAlgorithm() -> CCHmacAlgorithm { var result: Int=0 switchself { case .MD5: result = kCCHmacAlgMD5 case .SHA1: result = kCCHmacAlgSHA1 case .SHA224: result = kCCHmacAlgSHA224 case .SHA256: result = kCCHmacAlgSHA256 case .SHA384: result = kCCHmacAlgSHA384 case .SHA512: result = kCCHmacAlgSHA512 } returnCCHmacAlgorithm(result) }
funcdigestLength() -> Int { var result: CInt=0 switchself { case .MD5: result =CC_MD5_DIGEST_LENGTH case .SHA1: result =CC_SHA1_DIGEST_LENGTH case .SHA224: result =CC_SHA224_DIGEST_LENGTH case .SHA256: result =CC_SHA256_DIGEST_LENGTH case .SHA384: result =CC_SHA384_DIGEST_LENGTH case .SHA512: result =CC_SHA512_DIGEST_LENGTH } returnInt(result) } }