this repo has no description
at main 17 lines 324 B view raw
1package state 2 3import ( 4 "crypto/sha256" 5 "encoding/hex" 6 "fmt" 7) 8 9// HashContent returns the SHA256 hash of the given data. 10func HashContent(data []byte) string { 11 sum := sha256.Sum256(data) 12 return hex.EncodeToString(sum[:]) 13} 14 15func GenerateKey(appName, file string) string { 16 return fmt.Sprintf("%s:%s", appName, file) 17}