about summary refs log tree commit diff stats
path: root/internal/builder/hasher.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/builder/hasher.go')
-rw-r--r--internal/builder/hasher.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/builder/hasher.go b/internal/builder/hasher.go
new file mode 100644
index 0000000..dbc29f8
--- /dev/null
+++ b/internal/builder/hasher.go
@@ -0,0 +1,12 @@
+package builder
+
+import (
+	"crypto/sha256"
+	"encoding/base64"
+)
+
+func hash(s string) string {
+	shasum := sha256.New()
+	shasum.Write([]byte(s))
+	return "sha256-" + base64.StdEncoding.EncodeToString(shasum.Sum(nil))
+}