Files
attest/internal/util/crypto.go

16 lines
217 B
Go
Raw Permalink Normal View History

2024-04-15 15:20:56 -05:00
package util
import (
"crypto/sha256"
"encoding/hex"
)
2024-05-08 10:28:01 +01:00
func SHA256Hex(input []byte) string {
return hex.EncodeToString(SHA256(input))
2024-04-15 15:20:56 -05:00
}
2024-04-19 09:08:31 -05:00
2024-05-08 10:28:01 +01:00
func SHA256(data []byte) []byte {
2024-04-19 09:08:31 -05:00
h := sha256.Sum256(data)
return h[:]
}