Skip to content

Commit

Permalink
Update podspec, return old code for sha1, update project settings
Browse files Browse the repository at this point in the history
  • Loading branch information
turbulem committed Oct 2, 2018
1 parent e22724f commit c6dfbf1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 34 deletions.
25 changes: 0 additions & 25 deletions Package.resolved

This file was deleted.

10 changes: 4 additions & 6 deletions Sources/Starscream/WebSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1318,12 +1318,10 @@ open class WebSocket : NSObject, StreamDelegate, WebSocketClient, WSStreamDelega

private extension String {
func sha1Base64() -> String {
guard let data = self.data(using: .utf8) else { return "" }
var digest = [UInt8](repeating: 0, count: Int(CC_SHA1_DIGEST_LENGTH))
_ = data.withUnsafeBytes { (ptr: UnsafePointer<UInt8>) in
CC_SHA1(ptr, CC_LONG(data.count), &digest)
}
return digest.reduce("", { $0 + String(format: "%02x", $1) })
let data = self.data(using: String.Encoding.utf8)!
var digest = [UInt8](repeating: 0, count:Int(CC_SHA1_DIGEST_LENGTH))
data.withUnsafeBytes { _ = CC_SHA1($0, CC_LONG(data.count), &digest) }
return Data(bytes: digest).base64EncodedString()
}
}

Expand Down
4 changes: 1 addition & 3 deletions Starscream.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'
s.source_files = 'Sources/**/*.{h,m,swift}'
s.module_map = 'Sources/modulemap/Starscream.modulemap'
s.private_header_files = 'Sources/modulemap/**/*.h'
s.source_files = 'Sources/**/*.swift'
s.pod_target_xcconfig = {
'SWIFT_VERSION' => '4.1'
}
Expand Down

0 comments on commit c6dfbf1

Please sign in to comment.