Data Extension Reference
Data
extension Data
-
Calculate the
CRC32checksum of the receiver.Declaration
Swift
public func crc32(checksum: CRC32) -> CRC32Parameters
checksumThe starting seed.
Return Value
The checksum calculated from the bytes of the receiver and the starting seed.
-
Compress the output of
providerand pass it toconsumer.Declaration
Swift
public static func compress(size: Int64, bufferSize: Int, provider: Provider, consumer: Consumer) throws -> CRC32Parameters
sizeThe uncompressed size of the data to be compressed.
bufferSizeThe maximum size of the compression buffer.
providerA closure that accepts a position and a chunk size. Returns a
Datachunk.consumerA closure that processes the result of the compress operation.
Return Value
The checksum of the processed content.
-
Decompress the output of
providerand pass it toconsumer.Declaration
Swift
public static func decompress(size: Int64, bufferSize: Int, skipCRC32: Bool, provider: Provider, consumer: Consumer) throws -> CRC32Parameters
sizeThe compressed size of the data to be decompressed.
bufferSizeThe maximum size of the decompression buffer.
skipCRC32Optional flag to skip calculation of the CRC32 checksum to improve performance.
providerA closure that accepts a position and a chunk size. Returns a
Datachunk.consumerA closure that processes the result of the decompress operation.
Return Value
The checksum of the processed content.
-
Declaration
Swift
static func compress(size: Int, bufferSize: Int, provider: (_ position: Int, _ size: Int) throws -> Data, consumer: Consumer) throws -> CRC32 -
Declaration
Swift
static func decompress(size: Int, bufferSize: Int, skipCRC32: Bool, provider: (_ position: Int, _ size: Int) throws -> Data, consumer: Consumer) throws -> CRC32
Report a docs issue
Copy this context into your team’s issue tracker or an email to support@idmission.com.
