form MiraiGo
(r io.ReadSeeker)
| 31 | // form MiraiGo |
| 32 | |
| 33 | func ComputeMd5AndLength(r io.ReadSeeker) ([]byte, uint32) { |
| 34 | _, _ = r.Seek(0, io.SeekStart) |
| 35 | defer func(r io.ReadSeeker, offset int64, whence int) { |
| 36 | _, _ = r.Seek(offset, whence) |
| 37 | }(r, 0, io.SeekStart) |
| 38 | h := md5.New() |
| 39 | length, _ := io.Copy(h, r) |
| 40 | return h.Sum(nil), uint32(length) |
| 41 | } |
| 42 | |
| 43 | func ComputeMd5AndLengthWithLimit(r io.ReadSeeker, limit int64) ([]byte, uint32) { |
| 44 | _, _ = r.Seek(0, io.SeekStart) |
no outgoing calls
no test coverage detected