CPIOArchiveKit Documentation

Structure Checksum

public struct Checksum: Codable, Equatable  

Checksum is the sum of all bytes in the file data. This sum is computed treating all bytes as unsigned values and using unsigned arithmetic. Only the least-significant 32 bits of the sum are stored. (From go-cpio's documentation).

Use Checksum.init(bytes:) to compute the checksum of a file you will add to the archive.

%11 Checksum Checksum Equatable Equatable Checksum->Equatable Codable Codable Checksum->Codable

Conforms To

Codable
Equatable

Initializers

init(bytes:​)

public init(bytes: [UInt8])  

Compute the checksum of bytes.

init(sum:​)

public init(sum: Int)  

Set self.sum to a pre-computed checksum.

Properties

sum

public var sum: Int = 0

The sum of all the bytes in the file.