all repos — website @ f690e8cb7a820b0685b98f83a6761cfc169487e4

My website

internal/builder/hasher.go (view raw)

1
2
3
4
5
6
7
8
9
10
11
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))
}