diff --git a/Sources/FilestackSDK/Internal/Extensions/Data+base64MD5Digest.swift b/Sources/FilestackSDK/Internal/Extensions/Data+base64MD5Digest.swift index 0b833e2..f6a1252 100644 --- a/Sources/FilestackSDK/Internal/Extensions/Data+base64MD5Digest.swift +++ b/Sources/FilestackSDK/Internal/Extensions/Data+base64MD5Digest.swift @@ -15,7 +15,7 @@ extension Data { return Data((withUnsafeBytes { byte -> [UInt8] in var digest = [UInt8](repeating: 0, count: Int(CC_MD5_DIGEST_LENGTH)) - CC_MD5(byte.baseAddress, CC_LONG(count), &digest) + CC_SHA256(byte.baseAddress, CC_LONG(count), &digest) return digest })).base64EncodedString() diff --git a/Sources/FilestackSDK/Internal/Operations/CommitPartUploadOperation.swift b/Sources/FilestackSDK/Internal/Operations/CommitPartUploadOperation.swift index 43114e3..86b7567 100644 --- a/Sources/FilestackSDK/Internal/Operations/CommitPartUploadOperation.swift +++ b/Sources/FilestackSDK/Internal/Operations/CommitPartUploadOperation.swift @@ -8,7 +8,7 @@ import Foundation -class CommitPartUploadOperation: BaseOperation { +class CommitPartUploadOperation: BaseOperation, @unchecked Sendable { // MARK: - Private Properties private let descriptor: UploadDescriptor diff --git a/Sources/FilestackSDK/Internal/Operations/CompleteUploadOperation.swift b/Sources/FilestackSDK/Internal/Operations/CompleteUploadOperation.swift index 5698595..15f0ff1 100644 --- a/Sources/FilestackSDK/Internal/Operations/CompleteUploadOperation.swift +++ b/Sources/FilestackSDK/Internal/Operations/CompleteUploadOperation.swift @@ -8,7 +8,7 @@ import Foundation -class CompleteUploadOperation: BaseOperation { +class CompleteUploadOperation: BaseOperation, @unchecked Sendable { // MARK: - Private Properties private let partsAndEtags: [Int: String] diff --git a/Sources/FilestackSDK/Internal/Operations/StartUploadOperation.swift b/Sources/FilestackSDK/Internal/Operations/StartUploadOperation.swift index 7734224..b37b159 100644 --- a/Sources/FilestackSDK/Internal/Operations/StartUploadOperation.swift +++ b/Sources/FilestackSDK/Internal/Operations/StartUploadOperation.swift @@ -8,7 +8,7 @@ import Foundation -class StartUploadOperation: BaseOperation { +class StartUploadOperation: BaseOperation, @unchecked Sendable { // MARK: - Private Properties private let config: Config diff --git a/Sources/FilestackSDK/Internal/Operations/SubmitChunkUploadOperation.swift b/Sources/FilestackSDK/Internal/Operations/SubmitChunkUploadOperation.swift index a83ff3b..462613d 100644 --- a/Sources/FilestackSDK/Internal/Operations/SubmitChunkUploadOperation.swift +++ b/Sources/FilestackSDK/Internal/Operations/SubmitChunkUploadOperation.swift @@ -8,7 +8,7 @@ import Foundation -class SubmitChunkUploadOperation: BaseOperation { +class SubmitChunkUploadOperation: BaseOperation, @unchecked Sendable { // MARK: - Internal Properties // Part offset diff --git a/Sources/FilestackSDK/Internal/Operations/SubmitPartIntelligentUploadOperation.swift b/Sources/FilestackSDK/Internal/Operations/SubmitPartIntelligentUploadOperation.swift index 854f13c..7d03021 100644 --- a/Sources/FilestackSDK/Internal/Operations/SubmitPartIntelligentUploadOperation.swift +++ b/Sources/FilestackSDK/Internal/Operations/SubmitPartIntelligentUploadOperation.swift @@ -8,7 +8,7 @@ import Foundation -class SubmitPartIntelligentUploadOperation: BaseOperation, SubmitPartUploadOperation { +class SubmitPartIntelligentUploadOperation: BaseOperation, SubmitPartUploadOperation, @unchecked Sendable { // MARK: - Internal Properties let number: Int diff --git a/Sources/FilestackSDK/Internal/Operations/SubmitPartRegularUploadOperation.swift b/Sources/FilestackSDK/Internal/Operations/SubmitPartRegularUploadOperation.swift index ba9de45..98f20e1 100644 --- a/Sources/FilestackSDK/Internal/Operations/SubmitPartRegularUploadOperation.swift +++ b/Sources/FilestackSDK/Internal/Operations/SubmitPartRegularUploadOperation.swift @@ -8,7 +8,7 @@ import Foundation -class SubmitPartRegularUploadOperation: BaseOperation, SubmitPartUploadOperation { +class SubmitPartRegularUploadOperation: BaseOperation, SubmitPartUploadOperation, @unchecked Sendable { // MARK: - Internal Properties let number: Int diff --git a/Sources/FilestackSDK/Internal/Operations/SubmitPartsUploadOperation.swift b/Sources/FilestackSDK/Internal/Operations/SubmitPartsUploadOperation.swift index 3e3a090..ce4b0e2 100644 --- a/Sources/FilestackSDK/Internal/Operations/SubmitPartsUploadOperation.swift +++ b/Sources/FilestackSDK/Internal/Operations/SubmitPartsUploadOperation.swift @@ -8,7 +8,7 @@ import Foundation -class SubmitPartsUploadOperation: BaseOperation<[Int: String]> { +class SubmitPartsUploadOperation: BaseOperation<[Int: String]>, @unchecked Sendable { // MARK: - Internal Properties let descriptor: UploadDescriptor diff --git a/Sources/FilestackSDK/Internal/Operations/UploadOperation.swift b/Sources/FilestackSDK/Internal/Operations/UploadOperation.swift index 439b8d8..0e8b7ea 100644 --- a/Sources/FilestackSDK/Internal/Operations/UploadOperation.swift +++ b/Sources/FilestackSDK/Internal/Operations/UploadOperation.swift @@ -8,7 +8,7 @@ import Foundation -class UploadOperation: BaseOperation { +class UploadOperation: BaseOperation, @unchecked Sendable { // MARK: - Internal Properties private(set) lazy var progress: Progress = { diff --git a/Sources/FilestackSDK/Public/Operations/BaseOperation.swift b/Sources/FilestackSDK/Public/Operations/BaseOperation.swift index 416cdd1..49ee529 100644 --- a/Sources/FilestackSDK/Public/Operations/BaseOperation.swift +++ b/Sources/FilestackSDK/Public/Operations/BaseOperation.swift @@ -17,7 +17,7 @@ import Foundation /// - An executing operation will return `isExecuting` true. /// - A finished operation will return `isFinished` true. /// - A cancelled operation will return `isCancelled` true. -open class BaseOperation: Operation { +open class BaseOperation: Operation, @unchecked Sendable { public typealias Result = Swift.Result // MARK: - Private Properties @@ -81,7 +81,7 @@ open class BaseOperation: Operation { extension BaseOperation { /// Returns the result of operation. - open private(set) var result: Result { + public private(set) var result: Result { get { lockQueue.sync { _result } } set { lockQueue.sync { _result = newValue } } }