go/src/cmd/go/internal/cache/hash.go

var debugHash

const HashSize

type Hash

var hashSalt

// stripExperiment strips any GOEXPERIMENT configuration from the Go
// version string.
func stripExperiment(version string) string {}

// Subkey returns an action ID corresponding to mixing a parent
// action ID with a string description of the subkey.
func Subkey(parent ActionID, desc string) ActionID {}

// NewHash returns a new Hash.
// The caller is expected to Write data to it and then call Sum.
func NewHash(name string) *Hash {}

// Write writes data to the running hash.
func (h *Hash) Write(b []byte) (int, error) {}

// Sum returns the hash of the data written previously.
func (h *Hash) Sum() [HashSize]byte {}

var hashDebug

// reverseHash returns the input used to compute the hash id.
func reverseHash(id [HashSize]byte) string {}

var hashFileCache

// FileHash returns the hash of the named file.
// It caches repeated lookups for a given file,
// and the cache entry for a file can be initialized
// using SetFileHash.
// The hash used by FileHash is not the same as
// the hash used by NewHash.
func FileHash(file string) ([HashSize]byte, error) {}

// SetFileHash sets the hash returned by FileHash for file.
func SetFileHash(file string, sum [HashSize]byte) {}