aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/crypto/crypto.go3
-rw-r--r--internal/ui/static/static.go9
2 files changed, 6 insertions, 6 deletions
diff --git a/internal/crypto/crypto.go b/internal/crypto/crypto.go
index 0b0ab6c6..c99beeb8 100644
--- a/internal/crypto/crypto.go
+++ b/internal/crypto/crypto.go
@@ -17,8 +17,7 @@ import (
// HashFromBytes returns a SHA-256 checksum of the input.
func HashFromBytes(value []byte) string {
- sum := sha256.Sum256(value)
- return fmt.Sprintf("%x", sum)
+ return fmt.Sprintf("%x", sha256.Sum256(value))
}
// Hash returns a SHA-256 checksum of a string.
diff --git a/internal/ui/static/static.go b/internal/ui/static/static.go
index a3deb6d9..c417d23f 100644
--- a/internal/ui/static/static.go
+++ b/internal/ui/static/static.go
@@ -5,10 +5,11 @@ package static // import "miniflux.app/v2/internal/ui/static"
import (
"bytes"
- "crypto/sha256"
"embed"
"fmt"
+ "miniflux.app/v2/internal/crypto"
+
"github.com/tdewolff/minify/v2"
"github.com/tdewolff/minify/v2/css"
"github.com/tdewolff/minify/v2/js"
@@ -48,7 +49,7 @@ func CalculateBinaryFileChecksums() error {
return err
}
- binaryFileChecksums[dirEntry.Name()] = fmt.Sprintf("%x", sha256.Sum256(data))
+ binaryFileChecksums[dirEntry.Name()] = crypto.HashFromBytes(data)
}
return nil
@@ -102,7 +103,7 @@ func GenerateStylesheetsBundles() error {
}
StylesheetBundles[bundle] = minifiedData
- StylesheetBundleChecksums[bundle] = fmt.Sprintf("%x", sha256.Sum256(minifiedData))
+ StylesheetBundleChecksums[bundle] = crypto.HashFromBytes(minifiedData)
}
return nil
@@ -166,7 +167,7 @@ func GenerateJavascriptBundles() error {
}
JavascriptBundles[bundle] = minifiedData
- JavascriptBundleChecksums[bundle] = fmt.Sprintf("%x", sha256.Sum256(minifiedData))
+ JavascriptBundleChecksums[bundle] = crypto.HashFromBytes(minifiedData)
}
return nil