Skip to content

armgit / xtool

Public Imported from GitHub
0

Cross-platform Xcode replacement. Build and deploy iOS apps with SwiftPM on Linux, Windows, macOS.

Fix Linux build

Kabir Oberai7a81f904c13f
diff --git a/Supersign/Sources/Supersign/GrandSlam/Anisette/ADIDataProvider.swift b/Supersign/Sources/Supersign/GrandSlam/Anisette/ADIDataProvider.swift
index 2c7f638..886ac79 100644
--- a/Supersign/Sources/Supersign/GrandSlam/Anisette/ADIDataProvider.swift
+++ b/Supersign/Sources/Supersign/GrandSlam/Anisette/ADIDataProvider.swift
@@ -1,13 +1,18 @@
import Foundation
-import CryptoKit
+import CSupersign
enum HashingError: Error {
case hashingFailed
}
private extension String {
- func sha256() throws -> SHA256Digest {
- SHA256.hash(data: Data(utf8))
+ func sha256() throws -> [UInt8] {
+ try [UInt8](unsafeUninitializedCapacity: sup_sha256_buf_size()) { buf, count in
+ guard sup_sha256(self, utf8.count, buf.baseAddress!) == 0 else {
+ throw HashingError.hashingFailed
+ }
+ count = buf.count
+ }
}
}