Checksumable
public protocol Checksumable
The protocol any subject whose checksum may be calculated must conform to.
-
checksum(algorithm:chunkSize:queue:progress:completion:)Extension methodOn completion, returns a checksum of this
Checksumableusing the specified digest algorithm.Declaration
Swift
public func checksum(algorithm: DigestAlgorithm, chunkSize: Chunksize = .normal, queue: DispatchQueue = .main, progress: ProgressHandler? = nil, completion: @escaping CompletionHandler)Parameters
algorithmThe digest algorithm to use.
chunkSizeThe processing buffer’s size (mostly relevant for large data computing)
queueThe dispatch queue on which to call progress and completion closures.
progressThe closure to call to signal progress.
completionThe closure to call upon completion containing the result.
-
checksum(algorithm:chunkSize:)Extension methodReturns a checksum of this
Checksumableusing the specified digest algorithm.Declaration
Swift
public func checksum(algorithm: DigestAlgorithm, chunkSize: Chunksize = .normal) -> String?Parameters
algorithmThe digest algorithm to use.
chunkSizeThe internal buffer’s size (mostly relevant for large data computing.)
Return Value
A
Stringcontaining with the computed checksum.
View on GitHub
Checksumable Protocol Reference