diff --git a/cmd/hash.go b/cmd/hash.go index b804e24..ba92c3f 100644 --- a/cmd/hash.go +++ b/cmd/hash.go @@ -40,6 +40,7 @@ func (r *FileHash) Hash(h hash.Hash) (s string, err error) { if _, err = r.File.Seek(0, 0); err != nil { return } + h.Reset() r.ProgressRecorder.Reset() if _, err = r.copyBuffer(h, r.File, buf); err != nil { if err == errStop { diff --git a/cmd/unitmainImpl.go b/cmd/unitmainImpl.go index 6ad2469..430b0bd 100644 --- a/cmd/unitmainImpl.go +++ b/cmd/unitmainImpl.go @@ -283,7 +283,7 @@ showResult: info.WriteString(fmt.Sprintf("%s: %s\r\n", hashAlg.Name, s)) } } - info.WriteString(fmt.Sprintf("总耗时: %s\r\n", time.Since(t))) - info.WriteString(fmt.Sprintf("平均速度: %s/s\r\n", humanize.IBytes(uint64(float64(fileInfo.Size())/time.Since(t).Seconds())))) + info.WriteString(fmt.Sprintf("耗时: %s\r\n", time.Since(t))) + info.WriteString(fmt.Sprintf("速度: %s/s\r\n", humanize.IBytes(uint64(float64(fileInfo.Size())/time.Since(t).Seconds())))) f.MemoLogger.Lines().Add(info.String()) }