Checksumable

public protocol Checksumable

The protocol any subject whose checksum may be calculated must conform to.

  • On completion, returns a checksum of this Checksumable using the specified digest algorithm.

    Declaration

    Swift

    public func checksum(algorithm: DigestAlgorithm,
                         chunkSize: Chunksize = .normal,
                         queue: DispatchQueue = .main,
                         progress: ProgressHandler? = nil,
                         completion: @escaping CompletionHandler)

    Parameters

    algorithm

    The digest algorithm to use.

    chunkSize

    The processing buffer’s size (mostly relevant for large data computing)

    queue

    The dispatch queue on which to call progress and completion closures.

    progress

    The closure to call to signal progress.

    completion

    The closure to call upon completion containing the result.

  • Returns a checksum of this Checksumable using the specified digest algorithm.

    Declaration

    Swift

    public func checksum(algorithm: DigestAlgorithm, chunkSize: Chunksize = .normal) -> String?

    Parameters

    algorithm

    The digest algorithm to use.

    chunkSize

    The internal buffer’s size (mostly relevant for large data computing.)

    Return Value

    A String containing with the computed checksum.