github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/libnetwork/resolvconf/utils.go (about) 1 package resolvconf 2 3 import ( 4 "crypto/sha256" 5 "encoding/hex" 6 ) 7 8 // hashData returns the sha256 sum of data. 9 func hashData(data []byte) []byte { 10 f := sha256.Sum256(data) 11 out := make([]byte, 2*sha256.Size) 12 hex.Encode(out, f[:]) 13 return append([]byte("sha256:"), out...) 14 }