summaryrefslogtreecommitdiffstats
path: root/resources/internal/key.go
diff options
context:
space:
mode:
Diffstat (limited to 'resources/internal/key.go')
-rw-r--r--resources/internal/key.go25
1 files changed, 2 insertions, 23 deletions
diff --git a/resources/internal/key.go b/resources/internal/key.go
index 17543b0d4..d67d4a7e1 100644
--- a/resources/internal/key.go
+++ b/resources/internal/key.go
@@ -13,11 +13,7 @@
package internal
-import (
- "strconv"
-
- "github.com/mitchellh/hashstructure"
-)
+import "github.com/gohugoio/hugo/helpers"
// ResourceTransformationKey are provided by the different transformation implementations.
// It identifies the transformation (name) and its configuration (elements).
@@ -42,23 +38,6 @@ func (k ResourceTransformationKey) Value() string {
return k.Name
}
- return k.Name + "_" + HashString(k.elements...)
-
-}
-
-// HashString returns a hash from the given elements.
-// It will panic if the hash cannot be calculated.
-func HashString(elements ...interface{}) string {
- var o interface{}
- if len(elements) == 1 {
- o = elements[0]
- } else {
- o = elements
- }
+ return k.Name + "_" + helpers.HashString(k.elements...)
- hash, err := hashstructure.Hash(o, nil)
- if err != nil {
- panic(err)
- }
- return strconv.FormatUint(hash, 10)
}