From 852cc60a9e931cdff7b52e603823c035f811d9a7 Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 14 May 2023 22:53:25 +0200 Subject: [PATCH] go(funcmap): add sha384,sha512 funcs --- modules/funcmap/funcmap.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/funcmap/funcmap.go b/modules/funcmap/funcmap.go index 75adadc..50e5dc8 100644 --- a/modules/funcmap/funcmap.go +++ b/modules/funcmap/funcmap.go @@ -32,6 +32,26 @@ func FuncMap() template.FuncMap { return "" } + return *r + }, + "sha384": func(path string) string { + t := New("sha384") + + r, err := t.Integrity(path, isLive) + if err != nil { + return "" + } + + return *r + }, + "sha512": func(path string) string { + t := New("sha512") + + r, err := t.Integrity(path, isLive) + if err != nil { + return "" + } + return *r }, }