(targetSha1 string)
| 26 | } |
| 27 | |
| 28 | func (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 | |
| 40 | func (c *sha1Checksum) ComputeFileSha1() ([]byte, error) { |
| 41 | hash := sha1.New() |
nothing calls this directly
no test coverage detected