utils.go 218 B

123456789101112
  1. package resolvconf
  2. import (
  3. "crypto/sha256"
  4. "encoding/hex"
  5. )
  6. // hashData returns the sha256 sum of data.
  7. func hashData(data []byte) string {
  8. f := sha256.Sum256(data)
  9. return "sha256:" + hex.EncodeToString(f[:])
  10. }