(r io.ReadSeeker)
| 52 | } |
| 53 | |
| 54 | func ComputeSha1AndLength(r io.ReadSeeker) ([]byte, uint32) { |
| 55 | _, _ = r.Seek(0, io.SeekStart) |
| 56 | defer func(r io.ReadSeeker, offset int64, whence int) { |
| 57 | _, _ = r.Seek(offset, whence) |
| 58 | }(r, 0, io.SeekStart) |
| 59 | h := sha1.New() |
| 60 | length, _ := io.Copy(h, r) |
| 61 | return h.Sum(nil), uint32(length) |
| 62 | } |
| 63 | |
| 64 | func ComputeMd5AndSha1AndLength(r io.ReadSeeker) ([]byte, []byte, uint64) { |
| 65 | defer func(r io.ReadSeeker, offset int64, whence int) { |
no outgoing calls
no test coverage detected