diff --git a/common/hashing/hashing.go b/common/hashing/hashing.go
index 0b470cafe..18ec82623 100644
--- a/common/hashing/hashing.go
+++ b/common/hashing/hashing.go
@@ -83,6 +83,13 @@ func HashString(vs ...any) string {
return strconv.FormatUint(hash, 10)
}
+// HashStringHex returns a hash from the given elements as a hex encoded string.
+// See HashString for more information.
+func HashStringHex(vs ...any) string {
+ hash := HashUint64(vs...)
+ return strconv.FormatUint(hash, 16)
+}
+
var hashOptsPool = sync.Pool{
New: func() any {
return &hashstructure.HashOptions{
diff --git a/tpl/images/images.go b/tpl/images/images.go
index 08ab3cc95..106c2b280 100644
--- a/tpl/images/images.go
+++ b/tpl/images/images.go
@@ -169,7 +169,7 @@ func (ns *Namespace) QR(options any) (images.ImageResource, error) {
return nil, errors.New("scale must be an integer greater than or equal to 2")
}
- targetPath := path.Join(opts.TargetDir, fmt.Sprintf("qr_%s.png", hashing.HashString(opts)))
+ targetPath := path.Join(opts.TargetDir, fmt.Sprintf("qr_%s.png", hashing.HashStringHex(opts)))
r, err := ns.createClient.FromOpts(
create.Options{
diff --git a/tpl/images/images_integration_test.go b/tpl/images/images_integration_test.go
index e9a31c9af..0f89dbe09 100644
--- a/tpl/images/images_integration_test.go
+++ b/tpl/images/images_integration_test.go
@@ -79,14 +79,14 @@ disableKinds = ['page','rss','section','sitemap','taxonomy','term']
b := hugolib.Test(t, files)
b.AssertFileContent("public/index.html",
- `
`,
- `
`,
- `
`,
- `
`,
- `
`,
- `
`,
- `
`,
- `
`,
+ `
`,
+ `
`,
+ `
`,
+ `
`,
+ `
`,
+ `
`,
+ `
`,
+ `
`,
)
files = strings.ReplaceAll(files, "low", "foo")
diff --git a/tpl/tplimpl/tplimpl_integration_test.go b/tpl/tplimpl/tplimpl_integration_test.go
index 636e6aa68..04abb5b31 100644
--- a/tpl/tplimpl/tplimpl_integration_test.go
+++ b/tpl/tplimpl/tplimpl_integration_test.go
@@ -730,7 +730,7 @@ https://gohugo.io"
b := hugolib.Test(t, files)
b.AssertFileContent("public/index.html",
- `
`,
- `
`,
+ `
`,
+ `
`,
)
}