Files
attest/internal/util/crypto.go
2024-05-08 13:09:25 +01:00

16 lines
217 B
Go

package util
import (
"crypto/sha256"
"encoding/hex"
)
func SHA256Hex(input []byte) string {
return hex.EncodeToString(SHA256(input))
}
func SHA256(data []byte) []byte {
h := sha256.Sum256(data)
return h[:]
}