(chunkCount int)
| 97 | } |
| 98 | |
| 99 | func (e *Encoder) encodeFileHeader(chunkCount int) (err error) { |
| 100 | if _, err = e.Write(commitFileSignature); err == nil { |
| 101 | version := byte(1) |
| 102 | if hash.CryptoType == crypto.SHA256 { |
| 103 | version = byte(2) |
| 104 | } |
| 105 | _, err = e.Write([]byte{1, version, byte(chunkCount), 0}) |
| 106 | } |
| 107 | return |
| 108 | } |
| 109 | |
| 110 | func (e *Encoder) encodeChunkHeaders(chunkSignatures [][]byte, chunkSizes []uint64) (err error) { |
| 111 | // 8 bytes of file header, 12 bytes for each chunk header and 12 byte for terminator |