github.com/rawahars/moby@v24.0.4+incompatible/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  }