blob: 8e005e2a1922c4cad4350ca13e90de6f73af7d3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
package resolvconf
import (
"crypto/sha256"
"encoding/hex"
)
// hashData returns the sha256 sum of data.
func hashData(data []byte) []byte {
f := sha256.Sum256(data)
out := make([]byte, 2*sha256.Size)
hex.Encode(out, f[:])
return append([]byte("sha256:"), out...)
}
|