We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0b38175 + 1a4c6e8 commit bc4c23bCopy full SHA for bc4c23b
1 file changed
pkg/templatelib/lib.go
@@ -1,6 +1,8 @@
1
package templatelib
2
3
import (
4
+ "crypto/sha256"
5
+ "encoding/hex"
6
"encoding/json"
7
"fmt"
8
"os"
@@ -135,4 +137,10 @@ var FuncMap = template.FuncMap{
135
137
return unsetVal
136
138
}
139
}),
140
+
141
+ // {{- sha256sum "hello world" -}}
142
+ "sha256sum": func(input string) string {
143
+ hash := sha256.Sum256([]byte(input))
144
+ return hex.EncodeToString(hash[:])
145
+ },
146
0 commit comments