about summary refs log tree commit diff stats
path: root/internal/builder/hasher.go
blob: f0f91678bb8d1f39f1e556268fb5eeff971b4730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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))
}