(chunkCount int)
| 111 | } |
| 112 | |
| 113 | func (e *Encoder) encodeFileHeader(chunkCount int) (err error) { |
| 114 | if _, err = e.Write(commitFileSignature); err == nil { |
| 115 | version := byte(1) |
| 116 | if hash.CryptoType == crypto.SHA256 { |
| 117 | version = byte(2) |
| 118 | } |
| 119 | _, err = e.Write([]byte{1, version, byte(chunkCount), 0}) |
| 120 | } |
| 121 | return |
| 122 | } |
| 123 | |
| 124 | func (e *Encoder) encodeChunkHeaders(chunkSignatures [][]byte, chunkSizes []uint64) (err error) { |
| 125 | // 8 bytes of file header, 12 bytes for each chunk header and 12 byte for terminator |