Skip to content

Commit

Permalink
Merge pull request #35 from gecko655/SHA1DigestWithKey
Browse files Browse the repository at this point in the history
Fixed crash when generating SHA1 digests, fixes #34
  • Loading branch information
mattdonnelly committed Sep 10, 2014
2 parents a770b78 + e7d516d commit 896fd9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Swifter/String+Swifter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ extension String {
let str = self.cStringUsingEncoding(NSUTF8StringEncoding)
let strLen = UInt(self.lengthOfBytesUsingEncoding(NSUTF8StringEncoding))
let digestLen = Int(CC_SHA1_DIGEST_LENGTH)
let result = UnsafeMutablePointer<CUnsignedChar>(bitPattern: digestLen)
let result = UnsafeMutablePointer<CUnsignedChar>.alloc(digestLen)
let keyStr = key.cStringUsingEncoding(NSUTF8StringEncoding)
let keyLen = UInt(key.lengthOfBytesUsingEncoding(NSUTF8StringEncoding))

Expand Down

0 comments on commit 896fd9c

Please sign in to comment.