ZDCFileChecksumInstruction

@interface ZDCFileChecksumInstruction : NSObject <NSCopying>

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

  • Specifies the algorithm to use when calculating the checksum. The default value is kHASH_Algorithm_Invalid, meaning this property MUST be set.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int algorithm;

    Swift

    var algorithm: Int32 { get set }
  • If set, then only a subsection of the file/stream will be part of the checksum. If nil, then the whole file/stream will be part of the checksum.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) NSValue *range;

    Swift

    var range: NSValue? { get set }
  • If set, then a separate checksum will be calculated for each chunkSize block. And the callbackBlock will be invoked with increasing chunkIndex numbers.

    If a range is configured, then a checksum will be calculated for each chunkSize block in the range. Otherwise, a checksum will be calculated for each chunkSize block in the file/stream.

    If the range/file/stream is not an exact multiple of the chunkSize then the last chunk will be smaller than chunkSize.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) NSNumber *chunkSize;

    Swift

    var chunkSize: NSNumber? { get set }
  • The dispatch queue on which to invoke the callbackBlock. If nil, then the dispatch_get_main_queue() is used.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable)
        dispatch_queue_t callbackQueue;

    Swift

    var callbackQueue: DispatchQueue? { get set }
  • The block to invoke with the checksum information.

    If a chunkSize is set, this block may be called multiple times, with increasing chunkIndex values. If a chunkSize is not set, this block is invoked once at the end of the range/file/stream.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable)
        ZDCFileChecksumCallbackBlock callbackBlock;

    Swift

    var callbackBlock: ZDCFileChecksumCallbackBlock? { get set }