summaryrefslogtreecommitdiffstats
path: root/helpers/general.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/general.go')
-rw-r--r--helpers/general.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/helpers/general.go b/helpers/general.go
index cfabab5a9..00caf1ecc 100644
--- a/helpers/general.go
+++ b/helpers/general.go
@@ -394,11 +394,10 @@ func MD5FromFileFast(r io.ReadSeeker) (string, error) {
return hex.EncodeToString(h.Sum(nil)), nil
}
-// MD5FromFile creates a MD5 hash from the given file.
-// It will not close the file.
-func MD5FromFile(f afero.File) (string, error) {
+// MD5FromReader creates a MD5 hash from the given reader.
+func MD5FromReader(r io.Reader) (string, error) {
h := md5.New()
- if _, err := io.Copy(h, f); err != nil {
+ if _, err := io.Copy(h, r); err != nil {
return "", nil
}
return hex.EncodeToString(h.Sum(nil)), nil