Skip to content

Commit 4e7a209

Browse files
authored
Merge pull request #1 from kcramer/swift5
Swift 5 and Xcode 10.2, fix warnings in Crypto.
2 parents a42403b + 09e99d0 commit 4e7a209

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2
1+
5.0

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
matrix:
22
include:
3-
- name: "macOS Xcode 10.1 Test"
4-
osx_image: xcode10.1
3+
- name: "macOS Xcode 10.2 Test"
4+
osx_image: xcode10.2
55
xcode_workspace: ComposableCacheKit.xcworkspace
66
xcode_scheme: ComposableCacheKit
77
xcode_destination: platform=macOS

ComposableCacheKit.podspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'ComposableCacheKit'
3-
s.version = '0.1.0'
3+
s.version = '0.2.0'
44
s.summary = 'A Swift framework that provides a lightweight, composable cache.'
55
s.description = <<-DESC
66
ComposableCacheKit is a Swift framework that provides a lightweight, composable cache.
@@ -13,6 +13,7 @@ ComposableCacheKit is a Swift framework that provides a lightweight, composable
1313

1414
s.dependency 'Promises'
1515

16+
s.swift_version = '5.0'
1617
s.ios.deployment_target = '10.0'
1718
s.osx.deployment_target = '10.12'
1819
s.watchos.deployment_target = '3.0'

ComposableCacheKit.xcodeproj/project.pbxproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,11 @@
272272
TargetAttributes = {
273273
0AF47AAE21BA29720003F8CA = {
274274
CreatedOnToolsVersion = 10.1;
275-
LastSwiftMigration = 1010;
275+
LastSwiftMigration = 1020;
276276
};
277277
0AF47AB721BA29720003F8CA = {
278278
CreatedOnToolsVersion = 10.1;
279+
LastSwiftMigration = 1020;
279280
};
280281
0AF47ADC21BA54160003F8CA = {
281282
CreatedOnToolsVersion = 10.1;
@@ -288,6 +289,7 @@
288289
hasScannedForEncodings = 0;
289290
knownRegions = (
290291
en,
292+
Base,
291293
);
292294
mainGroup = 0AF47AA521BA29720003F8CA;
293295
productRefGroup = 0AF47AB021BA29720003F8CA /* Products */;
@@ -613,7 +615,7 @@
613615
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
614616
SKIP_INSTALL = YES;
615617
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
616-
SWIFT_VERSION = 4.2;
618+
SWIFT_VERSION = 5.0;
617619
};
618620
name = Debug;
619621
};
@@ -641,7 +643,7 @@
641643
PRODUCT_BUNDLE_IDENTIFIER = net.kevincramer.ComposableCacheKit;
642644
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
643645
SKIP_INSTALL = YES;
644-
SWIFT_VERSION = 4.2;
646+
SWIFT_VERSION = 5.0;
645647
};
646648
name = Release;
647649
};
@@ -663,7 +665,7 @@
663665
);
664666
PRODUCT_BUNDLE_IDENTIFIER = net.kevincramer.ComposableCacheKitTests;
665667
PRODUCT_NAME = "$(TARGET_NAME)";
666-
SWIFT_VERSION = 4.2;
668+
SWIFT_VERSION = 5.0;
667669
};
668670
name = Debug;
669671
};
@@ -685,7 +687,7 @@
685687
);
686688
PRODUCT_BUNDLE_IDENTIFIER = net.kevincramer.ComposableCacheKitTests;
687689
PRODUCT_NAME = "$(TARGET_NAME)";
688-
SWIFT_VERSION = 4.2;
690+
SWIFT_VERSION = 5.0;
689691
};
690692
name = Release;
691693
};

ComposableCacheKit/Crypto.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ internal struct Crypto {
1414
/// Returns the SHA256 hash of a Data as a Data value.
1515
internal static func sha256(data: Data) -> Data {
1616
var hash = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
17-
data.withUnsafeBytes { bytes in
18-
_ = CC_SHA256(bytes, CC_LONG(data.count), &hash)
19-
}
20-
return Data(bytes: hash)
17+
let bytes = [UInt8](data)
18+
CC_SHA256(bytes, CC_LONG(data.count), &hash)
19+
return Data(hash)
2120
}
2221

2322
/// Returns the SHA256 hash of a string as a hexadecimal string.

0 commit comments

Comments
 (0)