-
Notifications
You must be signed in to change notification settings - Fork 129
HashAlgorithm conformance that wraps CryptoKit.SHA256 #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@swift-ci please test |
c21c165 to
6f61d33
Compare
|
@swift-ci please test |
1 similar comment
|
@swift-ci please test |
6f61d33 to
dfed635
Compare
|
@swift-ci please test |
1 similar comment
|
@swift-ci please test |
dfed635 to
d6e5647
Compare
|
@swift-ci please test |
1 similar comment
|
@swift-ci please test |
d6e5647 to
a1391d6
Compare
|
@swift-ci please test |
|
@swift-ci test |
a1391d6 to
8193aec
Compare
|
@swift-ci test |
1 similar comment
|
@swift-ci test |
8193aec to
3321050
Compare
|
@swift-ci test |
1 similar comment
|
@swift-ci test |
| if #available(macOS 10.15, *) { | ||
| return bytes.withData { data in | ||
| let digest = CryptoKit.SHA256.hash(data: data) | ||
| return ByteString(digest) | ||
| } | ||
| } else { | ||
| fatalError("not supported on this platform") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will need to use conditional compilation directives.
- if #available(macOS 10.15, *) {
+ #if canImport(CryptoKit)
return bytes.withData { data in
let digest = CryptoKit.SHA256.hash(data: data)
return ByteString(digest)
}
- } else {
+ #else
fatalError("not supported on this platform")
- }
+ #endifThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That resolves the Linux issue, but macOS still does not weak link the framework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3321050 to
f34f419
Compare
|
@swift-ci test |
No description provided.