aboutsummaryrefslogtreecommitdiff
path: root/internal/hash.go
blob: 818ad550f44c2734b266c6dffbacdfe36f8e26e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
package internal

import (
	"crypto/sha256"
	"encoding/hex"
)

func SHA256sum(text string) string {
	hash := sha256.New()
	hash.Write([]byte(text))
	return hex.EncodeToString(hash.Sum(nil))
}