ChecksumsForFile generates size, MD5, SHA1 & SHA256 checksums for the file at the given path
(path string)
| 60 | // ChecksumsForFile generates size, MD5, SHA1 & SHA256 checksums for the file at |
| 61 | // the given path |
| 62 | func ChecksumsForFile(path string) (ChecksumInfo, error) { |
| 63 | file, err := os.Open(path) |
| 64 | if err != nil { |
| 65 | return ChecksumInfo{}, err |
| 66 | } |
| 67 | defer func() { |
| 68 | _ = file.Close() |
| 69 | }() |
| 70 | |
| 71 | return ChecksumsForReader(file) |
| 72 | } |
| 73 | |
| 74 | // ChecksumWriter is a writer that does checksum calculation on the fly passing data |
| 75 | // to real writer |