MCPcopy Index your code
hub / github.com/cloudfoundry/cli / CheckSha1

Method CheckSha1

util/checksum.go:28–38  ·  view source on GitHub ↗
(targetSha1 string)

Source from the content-addressed store, hash-verified

26}
27
28func (c *sha1Checksum) CheckSha1(targetSha1 string) bool {
29 sha1, err := c.ComputeFileSha1()
30 if err != nil {
31 return false
32 }
33
34 if fmt.Sprintf("%x", sha1) == targetSha1 {
35 return true
36 }
37 return false
38}
39
40func (c *sha1Checksum) ComputeFileSha1() ([]byte, error) {
41 hash := sha1.New()

Callers

nothing calls this directly

Calls 1

ComputeFileSha1Method · 0.95

Tested by

no test coverage detected