Files
attest/internal/util/crypto.go

19 lines
279 B
Go
Raw Permalink Normal View History

2024-04-15 15:20:56 -05:00
package util
import (
"crypto/sha256"
"encoding/hex"
)
func HexHashBytes(input []byte) string {
s256 := sha256.New()
s256.Write(input)
hashSum := s256.Sum(nil)
return hex.EncodeToString(hashSum)
}
2024-04-19 09:08:31 -05:00
func S256(data []byte) []byte {
h := sha256.Sum256(data)
return h[:]
}