about summary refs log tree commit diff stats
path: root/internal/builder/hasher.go
diff options
context:
space:
mode:
authorAlan Pearce2024-06-13 20:51:49 +0200
committerAlan Pearce2024-06-13 20:52:16 +0200
commitf690e8cb7a820b0685b98f83a6761cfc169487e4 (patch)
tree3102375c3c3c9461776a79082f4db9898c1eee5e /internal/builder/hasher.go
parent6b1697144e6261c09f1d2c254cf33d39f02ce92e (diff)
downloadwebsite-f690e8cb7a820b0685b98f83a6761cfc169487e4.tar.lz
website-f690e8cb7a820b0685b98f83a6761cfc169487e4.tar.zst
website-f690e8cb7a820b0685b98f83a6761cfc169487e4.zip
hash style elements during build step
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))
+}