func (tsd *Digest) Reset() { tsd.headerBuffer.Reset() tsd.currentBuffer.Reset() tsd.digestStage = stageReadHeader tsd.tarReader = new(tar.Reader) tsd.entryHash = sha256.New() tsd.sums = fileInfoSums{} tsd.fileCounter = 0 tsd.bytesWritten = 0 tsd.currentFilename = "" tsd.pad = 0 tsd.err = nil }
func (tsd *Digest) Sum(extra []byte) []byte { tsd.sums.SortBySums() hasher := sha256.New() if extra != nil { hasher.Write(extra) } for _, fis := range tsd.sums { hasher.Write([]byte(fis.Sum())) } return hasher.Sum(nil) }
func (tsd *Digest) BlockSize() int { return sha256.New().BlockSize() }
func (tsd *Digest) Size() int { return sha256.New().Size() }